diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-06-01 23:26:29 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-06-01 23:26:29 +0300 |
commit | e2cfe666ad05e9d08d1a24e27d558c9a5a96749d (patch) | |
tree | cca80b2c819da6c9d5cc6ce3108ecd62f71dbcf3 /io_scene_gltf2/blender | |
parent | c7aa80f40ae438618498bc678409a4260f4356ab (diff) |
glTF importer: Fix animation import when names was too long
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py | 6 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py index 2cb196ab..d049afba 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_bone.py @@ -250,6 +250,12 @@ class BlenderBoneAnim(): name = animation.name + "_" + obj.name else: name = "Animation_" + str(anim_idx) + "_" + obj.name + if len(name) >= 63: + # Name is too long to be kept, we are going to keep only animation name for now + name = animation.name + if len(name) >= 63: + # Very long name! + name = "Animation_" + str(anim_idx) if name not in bpy.data.actions: action = bpy.data.actions.new(name) else: diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py index 6540edec..a1a23cca 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py @@ -80,6 +80,12 @@ class BlenderNodeAnim(): name = animation.name + "_" + obj.name else: name = "Animation_" + str(anim_idx) + "_" + obj.name + if len(name) >= 63: + # Name is too long to be kept, we are going to keep only animation name for now + name = animation.name + if len(name) >= 63: + # Very long name! + name = "Animation_" + str(anim_idx) action = bpy.data.actions.new(name) # Check if this action has some users. # If no user (only 1 indeed), that means that this action must be deleted |