[Bf-extensions-cvs] [ffcecad3] master: glTF exporter: add check when armature animation is linked to object != armature
Julien Duroure
noreply at git.blender.org
Thu Sep 5 07:28:06 CEST 2019
Commit: ffcecad3a8908db5037ac9474ab5524dadecc2cd
Author: Julien Duroure
Date: Thu Sep 5 07:27:35 2019 +0200
Branches: master
https://developer.blender.org/rBAffcecad3a8908db5037ac9474ab5524dadecc2cd
glTF exporter: add check when armature animation is linked to object != armature
===================================================================
M io_scene_gltf2/__init__.py
M io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
===================================================================
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index f06eb439..dedbce30 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (0, 9, 57),
+ "version": (0, 9, 58),
'blender': (2, 81, 6),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
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
More information about the Bf-extensions-cvs
mailing list