fix error when all shape keys muted
This commit is contained in:
parent
8f733222a9
commit
6c0d4bdead
|
@ -203,7 +203,12 @@ class ArmoryExporter:
|
|||
return None
|
||||
|
||||
shape_keys = mesh.shape_keys
|
||||
if shape_keys and len(shape_keys.key_blocks) > 1:
|
||||
if not shape_keys:
|
||||
return None
|
||||
if len(shape_keys.key_blocks) < 2:
|
||||
return None
|
||||
for shape_key in shape_keys.key_blocks[1:]:
|
||||
if(not shape_key.mute):
|
||||
return shape_keys
|
||||
return None
|
||||
|
||||
|
@ -1156,6 +1161,10 @@ class ArmoryExporter:
|
|||
|
||||
count += 1
|
||||
|
||||
# No shape keys present or all shape keys are muted
|
||||
if (count < 1):
|
||||
return
|
||||
|
||||
# Convert to array for easy manipulation
|
||||
pos_array = np.array(vert_pos)
|
||||
nor_array = np.array(vert_nor)
|
||||
|
|
|
@ -775,7 +775,12 @@ def export_morph_targets(bobject: bpy.types.Object) -> bool:
|
|||
return False
|
||||
|
||||
shape_keys = bobject.data.shape_keys
|
||||
if shape_keys and len(shape_keys.key_blocks) > 1:
|
||||
if not shape_keys:
|
||||
return False
|
||||
if len(shape_keys.key_blocks) < 2:
|
||||
return False
|
||||
for shape_key in shape_keys.key_blocks[1:]:
|
||||
if(not shape_key.mute):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in a new issue