From 105d385e4b73f353350a3a1894eb0d9e933130c3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Jan 2021 22:27:49 +1100 Subject: Fix T84364: Sculpt symmetrize fails with shape keys Use the BMesh symmetrize operator instead of using the modifier code. While we could support shape-keys with the existing code used by the mirror modifier, we'd need to add code-paths for evaluated mesh & bmesh conversion to handle shape-keys differently just for this one case, since we want to avoid copying & processing shape-keys layers for evaluated meshes in general. --- source/blender/modifiers/intern/MOD_mirror.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_mirror.c') diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 7f34c6581ad..afe94d8dead 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -81,20 +81,17 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte } } -static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd, - const ModifierEvalContext *ctx, - Object *ob, - Mesh *mesh) +static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd, Object *ob, Mesh *mesh) { Mesh *result = mesh; /* check which axes have been toggled and mirror accordingly */ if (mmd->flag & MOD_MIR_AXIS_X) { - result = BKE_mesh_mirror_apply_mirror_on_axis(mmd, ctx, ob, result, 0); + result = BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(mmd, ob, result, 0); } if (mmd->flag & MOD_MIR_AXIS_Y) { Mesh *tmp = result; - result = BKE_mesh_mirror_apply_mirror_on_axis(mmd, ctx, ob, result, 1); + result = BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(mmd, ob, result, 1); if (tmp != mesh) { /* free intermediate results */ BKE_id_free(NULL, tmp); @@ -102,7 +99,7 @@ static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd, } if (mmd->flag & MOD_MIR_AXIS_Z) { Mesh *tmp = result; - result = BKE_mesh_mirror_apply_mirror_on_axis(mmd, ctx, ob, result, 2); + result = BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(mmd, ob, result, 2); if (tmp != mesh) { /* free intermediate results */ BKE_id_free(NULL, tmp); @@ -117,7 +114,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * Mesh *result; MirrorModifierData *mmd = (MirrorModifierData *)md; - result = mirrorModifier__doMirror(mmd, ctx, ctx->object, mesh); + result = mirrorModifier__doMirror(mmd, ctx->object, mesh); if (result != mesh) { result->runtime.cd_dirty_vert |= CD_MASK_NORMAL; -- cgit v1.2.3