Skip to content

Commit

Permalink
Merge pull request #938 from woodbridge/jwb/glb
Browse files Browse the repository at this point in the history
Add support for GLB + GLTF
  • Loading branch information
cornerfarmer committed Jul 24, 2023
2 parents 19c3294 + 5635be4 commit 38ea43f
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 @@ -103,6 +103,8 @@ def load_obj(filepath: str, cached_objects: Optional[Dict[str, List[MeshObject]]
obj.data.materials.append(mat)
elif filepath.lower().endswith('.fbx'):
bpy.ops.import_scene.fbx(filepath=filepath)
elif filepath.lower().endswith('.glb') or filepath.lower().endswith('.gltf'):
bpy.ops.import_scene.gltf(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 38ea43f

Please sign in to comment.