diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-11-09 16:33:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-11-09 16:33:22 +0300 |
commit | 65c5ebf5779d07fb92fabd0ff992337f6c980cde (patch) | |
tree | 43b34a29ab9dcccf1c0a163e960f635e2a9a3043 /source/blender/editors | |
parent | 0b01b81754ec6352f290ad7c31680503bf6ab5eb (diff) |
Fix T91923: Save/Apply as Shape Key ignores shape keys
Support virtual modifiers when using applying the modifier as a shape.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index efe19785f31..21b978268d9 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -666,12 +666,13 @@ bool ED_object_modifier_convert(ReportList *UNUSED(reports), static Mesh *modifier_apply_create_mesh_for_modifier(Depsgraph *depsgraph, Object *object, ModifierData *md_eval, + bool use_virtual_modifiers, bool build_shapekey_layers) { Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); Object *object_eval = DEG_get_evaluated_object(depsgraph, object); Mesh *mesh_applied = BKE_mesh_create_derived_for_modifier( - depsgraph, scene_eval, object_eval, md_eval, build_shapekey_layers); + depsgraph, scene_eval, object_eval, md_eval, use_virtual_modifiers, build_shapekey_layers); return mesh_applied; } @@ -708,7 +709,8 @@ static bool modifier_apply_shape(Main *bmain, return false; } - Mesh *mesh_applied = modifier_apply_create_mesh_for_modifier(depsgraph, ob, md_eval, false); + Mesh *mesh_applied = modifier_apply_create_mesh_for_modifier( + depsgraph, ob, md_eval, true, false); if (!mesh_applied) { BKE_report(reports, RPT_ERROR, "Modifier is disabled or returned error, skipping apply"); return false; @@ -767,7 +769,8 @@ static bool modifier_apply_obdata( } } else { - Mesh *mesh_applied = modifier_apply_create_mesh_for_modifier(depsgraph, ob, md_eval, true); + Mesh *mesh_applied = modifier_apply_create_mesh_for_modifier( + depsgraph, ob, md_eval, true, true); if (!mesh_applied) { BKE_report(reports, RPT_ERROR, "Modifier returned error, skipping apply"); return false; |