Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(loader): add usd scene loader #1043

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(loader): add usd scene loader
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
commit 00b69da5bcc8fb0abc6d8212b764d55a96b32097
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
Loading