Skip to content

Commit

Permalink
feat(loader): add usd scene loader
Browse files Browse the repository at this point in the history
extension of the load_obj module allows loading .usd/.usdc/.usda files and load it as a scene

closes #1029
  • Loading branch information
freLorbeer committed Jan 16, 2024
1 parent 2dc7d68 commit 00b69da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blenderproc/python/loader/ObjectLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def load_obj(filepath: str, cached_objects: Optional[Dict[str, List[MeshObject]]
bpy.ops.import_scene.fbx(filepath=filepath)
elif filepath.lower().endswith('.glb') or filepath.lower().endswith('.gltf'):
bpy.ops.import_scene.gltf(filepath=filepath)
elif filepath.lower().endswith('.usda') or filepath.lower().endswith('.usd') or filepath.lower().endswith('.usdc'):
bpy.ops.wm.usd_import(filepath=filepath)

mesh_objects = convert_to_meshes([obj for obj in bpy.context.selected_objects
if obj not in previously_selected_objects])
Expand Down

0 comments on commit 00b69da

Please sign in to comment.