Cleanup: USD: Make use of newly exposed mesh validation API

Make use of the newly exposed mesh validation API to replace the custom
duplicate vertex index check.

Also, strengthen the test for this by using a mesh which should only
lose 2 of its 4 faces due to validation. The prior test only had 2 faces
and both would be destroyed. This guards against future problems like
issue #149429.

Pull Request: https://projects.blender.org/blender/blender/pulls/149882
This commit is contained in:
Jesse Yurkovich 2025-11-14 18:54:30 +01:00 • committed by Jesse Yurkovich
parent 241c81ed5f
commit 93c0c63415
3 changed files with 14 additions and 28 deletions

View file

@ -128,9 +128,11 @@ class USDImportTest(AbstractUSDTest):
# Test topology counts.
self.assertIn("m_degenerate", objects, "Scene does not contain object m_degenerate")
mesh = objects["m_degenerate"].data
self.assertEqual(len(mesh.polygons), 0)
self.assertEqual(len(mesh.edges), 0)
self.assertEqual(len(mesh.vertices), 6)
self.assertEqual(len(mesh.polygons), 2)
self.assertEqual(len(mesh.edges), 10)
self.assertEqual(len(mesh.vertices), 20)
self.assertEqual(len(mesh.polygons[0].vertices), 5)
self.assertEqual(len(mesh.polygons[1].vertices), 5)
self.assertIn("m_triangles", objects, "Scene does not contain object m_triangles")
mesh = objects["m_triangles"].data