Skip to content

Commit

Permalink
Fix #930 - bad shapekeys reference in blender API
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduroure committed Feb 19, 2020
1 parent 061e4bb commit f2f3b83
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ def __gather_weights(blender_mesh: bpy.types.Mesh,
export_settings
) -> Optional[List[float]]:

# Seems that in some files, when using Apply Modifier, shape_keys return an error
# ReferenceError: StructRNA of type Mesh has been removed
# Because shapekeys are not exported in that case, we can return None
try:
blender_mesh.shape_keys
except:
return None

if not export_settings[MORPH] or not blender_mesh.shape_keys:
return None

Expand Down

0 comments on commit f2f3b83

Please sign in to comment.