def test_export_single(self, out_dir, pointcloud): out_path = os.path.join(out_dir, 'pointcloud.usda') usd.export_pointcloud(pointcloud=pointcloud, file_path=out_path, scene_path=self.scene_path, points_type='usd_geom_points') # Confirm exported USD matches golden file golden = os.path.join(out_dir, '../../../../samples/golden/pointcloud_GeomPoints.usda') assert open(golden).read() == open(out_path).read()
def test_export_single_instancer(self, out_dir, pointcloud): out_path = os.path.join(out_dir, 'pointcloud_instancer.usda') usd.export_pointcloud(pointcloud=pointcloud, file_path=out_path, scene_path=self.scene_path) # Confirm exported USD matches golden file golden = os.path.join(out_dir, '../../../../samples/golden/pointcloud_PointInstancer.usda') assert open(golden).read() == open(out_path).read()
def test_get_authored_time_samples_timed(self, out_dir, mesh, voxelgrid, pointcloud): out_path = os.path.join(out_dir, 'timed.usda') usd.export_voxelgrid(file_path=out_path, voxelgrid=voxelgrid, scene_path='/World/voxelgrid') times = usd.get_authored_time_samples(out_path) assert times == [] usd.export_voxelgrid(file_path=out_path, voxelgrid=voxelgrid, scene_path='/World/voxelgrid', time=1) times = usd.get_authored_time_samples(out_path) assert times == [1] usd.export_mesh(out_path, scene_path='/World/meshes', vertices=mesh.vertices, faces=mesh.faces, time=20) usd.export_mesh(out_path, scene_path='/World/meshes', vertices=mesh.vertices, faces=None, time=250) times = usd.get_authored_time_samples(out_path) assert times == [1, 20, 250] usd.export_pointcloud(out_path, pointcloud)
def test_export_single_colors(self, out_dir, pointcloud_with_color): # Export a single pointcloud with colors pointcloud, color = pointcloud_with_color out_path = os.path.join(out_dir, 'pointcloud_colors.usda') usd.export_pointcloud(pointcloud=pointcloud, file_path=out_path, color=color, scene_path=self.scene_path, points_type='usd_geom_points') # Confirm exported USD matches golden file golden = os.path.join(out_dir, '../../../../samples/golden/pointcloud_GeomPoints_colors.usda') assert open(golden).read() == open(out_path).read()