glTF importer: Fix animation import when names was too long
This commit is contained in:
parent
c7aa80f40a
commit
e2cfe666ad
|
@ -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, 18),
|
||||
"version": (0, 9, 19),
|
||||
'blender': (2, 80, 0),
|
||||
'location': 'File > Import-Export',
|
||||
'description': 'Import-Export as glTF 2.0',
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue