This adds a new function, `compare_meshes`,
as a replacement for `BKE_mesh_cmp`.
The main benefits of the new version are the following:
- The code is written in c++, and makes use of the new attributes API.
- It adds an additional check, to see if the meshes only differ by
their indices. This is useful to verify correctness of new algorithmic
changes in mesh code, which might produce mesh elements in a different
order than the original algorithm. The tests will still fail, but the
error will show that the indices changed.
Some downsides:
- The code is more complex, due to having to be index-independent.
- The code is probably slower due to having to do comparisons "index-
independently". I have not tested this, as correctness was my priority
for this patch. A future update could look to improve the speed,
if that is desired.
- This is technically a breaking API change, since it changes the
returned values of `rna_Mesh_unit_test_compare`. I don't think that
there are many people (if any) using this, besides our own unit tests.
All tests that pass with `BKE_mesh_cmp` still pass with the new version.
**NOTE:**
Currently, mesh edge indices are allowed to be different in the
comparison, because `BKE_mesh_cmp` also allowed this. There are some
tests which would fail otherwise. These tests should be updated, and
then the corresponding code as well.
I wrote up a more detailed explanation of the algorithm here:
https://hackmd.io/@bo-JY945TOmvepQ1tAWy6w/SyuaFtay6
Pull Request: https://projects.blender.org/blender/blender/pulls/112794