diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-10-12 18:43:57 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-10-12 18:43:57 +0300 |
commit | 334ca375b5e67d668c5413e1ca432a4fc23274e1 (patch) | |
tree | 244f13f1caf275e7c7e574465fd51d648afbfd8e /io_scene_gltf2/blender/exp/gltf2_blender_gather.py | |
parent | ecdaef952383c28aa3793f86cee160202f46913b (diff) |
glTF exporter: export action custom props as animation extras
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py index 80e0c3b2..f4fd70dd 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py @@ -97,6 +97,14 @@ def __gather_animations(blender_scene, export_settings): to_delete_idx.append(anim_idx) + # Merging extras + # Warning, some values can be overwritten if present in multiple merged animations + if animations[anim_idx].extras is not None: + for k in animations[anim_idx].extras.keys(): + if animations[base_animation_idx].extras is None: + animations[base_animation_idx].extras = {} + animations[base_animation_idx].extras[k] = animations[anim_idx].extras[k] + offset_sampler = len(animations[base_animation_idx].samplers) for sampler in animations[anim_idx].samplers: animations[base_animation_idx].samplers.append(sampler) |