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

Collection Exporter: set collection custom prop as glTF scene extras #2470

Merged
merged 3 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions addons/io_scene_gltf2/blender/exp/gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,9 @@ def __gather_scene(blender_scene, export_settings):

def __gather_extras(blender_object, export_settings):
if export_settings['gltf_extras']:
# If case of collection export, use custom properties of the collection instead of the scene
# So Collection custom properties are exported as glTF Scene extras
if export_settings['gltf_collection']:
return generate_extras(bpy.data.collections[export_settings['gltf_collection']])
return generate_extras(blender_object)
return None
1 change: 1 addition & 0 deletions docs/blender_docs/scene_gltf2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ Here are the options & specificity for collection export:

- Include part of options are not available for collection exporter (like every other exporter).
- Option to export at collection center (at center of mass of all root objects of the collection).
- Custom Properties of the collection are exported as Scene glTF extras.


Contributing
Expand Down
Loading