fix error when all shape keys muted

This commit is contained in:
QuantumCoderQC 2021-10-28 17:18:02 +02:00
parent 8f733222a9
commit 6c0d4bdead
2 changed files with 18 additions and 4 deletions

View File

@ -203,8 +203,13 @@ class ArmoryExporter:
return None
shape_keys = mesh.shape_keys
if shape_keys and len(shape_keys.key_blocks) > 1:
return shape_keys
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
@staticmethod
@ -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)

View File

@ -775,8 +775,13 @@ 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:
return True
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
def export_vcols(bobject: bpy.types.Object) -> bool: