diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-04-09 19:49:11 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-04-09 19:49:11 +0300 |
commit | 8f48a57eac58b45fca34d39d7a52da9278be4009 (patch) | |
tree | d798e48d9c797c8988feb79b258cdc6ca80e7ab7 /io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py | |
parent | 8e72572153ed7166c284598c53af1e0ab4937263 (diff) |
glTF exporter: fix / enhancement of animation export
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 | 7 |
1 files changed, 4 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 808c970d..33962ee0 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 @@ -21,6 +21,7 @@ from io_scene_gltf2.io.com import gltf2_io_debug 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 @cached @@ -104,8 +105,8 @@ def __get_channel_groups(blender_action: bpy.types.Action, blender_object: bpy.t target = blender_object else: try: - target = blender_object.path_resolve(object_path) - except ValueError: + target = gltf2_blender_get.get_object_from_datapath(blender_object, object_path) + except ValueError as e: # 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": @@ -113,7 +114,7 @@ def __get_channel_groups(blender_action: bpy.types.Action, blender_object: bpy.t # shape_key = blender_object.data.shape_keys.path_resolve(object_path) target = blender_object.data.shape_keys else: - gltf2_io_debug.print_console("WARNING", "Can not export animations with target {}".format(object_path)) + gltf2_io_debug.print_console("WARNING", "Animation target {} not found".format(object_path)) continue # group channels by target object and affected property of the target |