Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2019-09-05 08:27:35 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-09-05 08:28:00 +0300
commitffcecad3a8908db5037ac9474ab5524dadecc2cd (patch)
tree6faf662957a7fe5b5271c598c1b215dac13bc0d9 /io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
parent1881beb8b12028a37ef34e7e746555c3707a9150 (diff)
glTF exporter: add check when armature animation is linked to object != armature
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py11
1 files changed, 8 insertions, 3 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 8eefafd4..90bd3b75 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
@@ -196,10 +196,15 @@ def __get_channel_groups(blender_action: bpy.types.Action, blender_object: bpy.t
# if the object is a mesh and the action target path can not be resolved, we know that this is a morph
# animation.
if blender_object.type == "MESH":
- shape_key = blender_object.data.shape_keys.path_resolve(object_path)
- if shape_key.mute is True:
+ try:
+ shape_key = blender_object.data.shape_keys.path_resolve(object_path)
+ if shape_key.mute is True:
+ continue
+ target = blender_object.data.shape_keys
+ except:
+ # Something is wrong, for example a bone animation is linked to an object mesh...
+ gltf2_io_debug.print_console("WARNING", "Animation target {} not found".format(object_path))
continue
- target = blender_object.data.shape_keys
else:
gltf2_io_debug.print_console("WARNING", "Animation target {} not found".format(object_path))
continue