Fix #104714: Missing shape keys in FBX export when original mesh data cannot be used #104890
@ -2551,6 +2551,7 @@ def fbx_data_from_scene(scene, depsgraph, settings):
|
||||
if settings.use_mesh_modifiers or settings.use_triangles or ob.type in BLENDER_OTHER_OBJECT_TYPES or is_ob_material:
|
||||
# We cannot use default mesh in that case, or material would not be the right ones...
|
||||
use_org_data = not (is_ob_material or ob.type in BLENDER_OTHER_OBJECT_TYPES)
|
||||
apply_modifiers = False
|
||||
backup_pose_positions = []
|
||||
tmp_mods = []
|
||||
if use_org_data and ob.type == 'MESH':
|
||||
@ -2581,9 +2582,11 @@ def fbx_data_from_scene(scene, depsgraph, settings):
|
||||
if settings.use_subsurf and mod.type == 'SUBSURF' and mod.subdivision_type == 'CATMULL_CLARK':
|
||||
if last_subsurf:
|
||||
use_org_data = False
|
||||
apply_modifiers = True
|
||||
last_subsurf = mod
|
||||
else:
|
||||
use_org_data = False
|
||||
apply_modifiers = True
|
||||
if settings.use_subsurf and last_subsurf:
|
||||
# XXX: When exporting with subsurf information temporarily disable
|
||||
# the last subsurf modifier.
|
||||
@ -2594,7 +2597,7 @@ def fbx_data_from_scene(scene, depsgraph, settings):
|
||||
# If modifiers has been altered need to update dependency graph.
|
||||
if backup_pose_positions or tmp_mods:
|
||||
depsgraph.update()
|
||||
if settings.use_mesh_modifiers or ob.type in BLENDER_OTHER_OBJECT_TYPES:
|
||||
if apply_modifiers or ob.type in BLENDER_OTHER_OBJECT_TYPES:
|
||||
ob_to_convert = ob.evaluated_get(depsgraph)
|
||||
# NOTE: The dependency graph might be re-evaluating multiple times, which could
|
||||
# potentially free the mesh created early on. So we put those meshes to bmain and
|
||||
|
Loading…
Reference in New Issue
Block a user