def test_import_hetero_skip(self, scene_paths, out_dir, hetero_mesh_path, mesh): """Test that import skips mesh when importing heterogeneous mesh with skip handler""" meshes = usd.import_meshes(hetero_mesh_path, ['/Root'], heterogeneous_mesh_handler=usd.heterogeneous_mesh_handler_skip) assert len(meshes) == 0 # Test skip on a batch of mixed homogeneous and heterogeneous meshes homogeneous_meshes = usd.import_meshes(os.path.join(out_dir, self.file_name)) mixed = meshes + homogeneous_meshes out_path = os.path.join(out_dir, 'mixed.usda') usd.export_meshes(out_path, vertices=[m.vertices for m in mixed], faces=[m.faces for m in mixed]) mixed_in = usd.import_meshes(out_path, heterogeneous_mesh_handler=usd.heterogeneous_mesh_handler_skip) assert len(mixed_in) == 2
def test_export_multiple(self, scene_paths, out_dir, mesh, mesh_alt): out_path = os.path.join(out_dir, self.file_name) # Export some meshes vertices_list = [mesh.vertices, mesh_alt.vertices] faces_list = [mesh.faces, mesh_alt.faces] stage = usd.export_meshes(out_path, scene_paths, vertices_list, faces_list)