diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-05 14:27:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-05 14:48:12 +0300 |
commit | 105d385e4b73f353350a3a1894eb0d9e933130c3 (patch) | |
tree | 601a0689e7caeeae235a45dc9f06266ab5a5176a /source/blender/modifiers/intern/MOD_mirror.c | |
parent | 724110487721226812a111cb147b85622f2c19e4 (diff) |
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.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mirror.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_mirror.c | 13 |
1 files changed, 5 insertions, 8 deletions
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; |