diff options
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py index edee0971..611cd74a 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py @@ -22,6 +22,7 @@ from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached from io_scene_gltf2.blender.exp import gltf2_blender_gather_animation_samplers from io_scene_gltf2.blender.exp import gltf2_blender_gather_animation_channel_target from io_scene_gltf2.blender.exp import gltf2_blender_get +from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins @cached @@ -58,7 +59,14 @@ def gather_animation_channels(blender_action: bpy.types.Action, return [] # Then bake all bones - for bone in blender_object.data.bones: + bones_to_be_animated = [] + if export_settings["gltf_def_bones"] is False: + bones_to_be_animated = blender_object.data.bones + else: + bones_to_be_animated, _, _ = gltf2_blender_gather_skins.get_bone_tree(None, blender_object) + bones_to_be_animated = [blender_object.pose.bones[b.name] for b in bones_to_be_animated] + + for bone in bones_to_be_animated: for p in ["location", "rotation_quaternion", "scale"]: channel = __gather_animation_channel( (), |