FBX IO: Fix import of shape key animations without any keyframes #105030

2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@
bl_info = { bl_info = {
"name": "FBX format", "name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier, @Mysteryem",
"version": (5, 8, 12), "version": (5, 8, 13),
"blender": (4, 0, 0), "blender": (4, 0, 0),
"location": "File > Import-Export", "location": "File > Import-Export",
"description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions", "description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions",

View File

@ -950,7 +950,6 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset, glo
blen_store_keyframes(fbx_key_times, blen_curve, values, anim_offset, fps) blen_store_keyframes(fbx_key_times, blen_curve, values, anim_offset, fps)
elif isinstance(item, ShapeKey): elif isinstance(item, ShapeKey):
deform_values = shape_key_deforms.setdefault(item, [])
for fbxprop, channel_to_curve in fbx_curves.items(): for fbxprop, channel_to_curve in fbx_curves.items():
assert(fbxprop == b'DeformPercent') assert(fbxprop == b'DeformPercent')
for channel, curve in channel_to_curve.items(): for channel, curve in channel_to_curve.items():
@ -964,8 +963,10 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset, glo
# Store the minimum and maximum shape key values, so that the shape key's slider range can be expanded # Store the minimum and maximum shape key values, so that the shape key's slider range can be expanded
# if necessary after reading all animations. # if necessary after reading all animations.
deform_values.append(values.min()) if values.size:
deform_values.append(values.max()) deform_values = shape_key_deforms.setdefault(item, [])
deform_values.append(values.min())
deform_values.append(values.max())
elif isinstance(item, Camera): elif isinstance(item, Camera):
for fbxprop, channel_to_curve in fbx_curves.items(): for fbxprop, channel_to_curve in fbx_curves.items():