From 5502517c3c12086c111ae5477fae9c0d2eb8a84c Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Fri, 18 Sep 2020 19:58:48 +0200 Subject: Unify all XYZ symmetry options using Mesh Symmetry This adds XYZ symmetry as a property of meshes and updates all modes to use the mesh symmetry by default to have a consistent tool behavior between all modes and when switching objects. Reviewed By: brecht, mano-wii, campbellbarton Maniphest Tasks: T79785 Differential Revision: https://developer.blender.org/D8587 --- source/blender/editors/sculpt_paint/paint_vertex.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 3753709875b..4a3babde5f3 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -765,7 +765,7 @@ static void do_weight_paint_vertex_single( MDeformWeight *dw_mirr; /* from now on we can check if mirrors enabled if this var is -1 and not bother with the flag */ - if (me->editflag & ME_EDIT_MIRROR_X) { + if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) { index_mirr = mesh_get_x_mirror_vert(ob, NULL, index, topology); vgroup_mirr = wpi->mirror.index; @@ -961,7 +961,7 @@ static void do_weight_paint_vertex_multi( float dw_rel_free, dw_rel_locked; /* from now on we can check if mirrors enabled if this var is -1 and not bother with the flag */ - if (me->editflag & ME_EDIT_MIRROR_X) { + if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) { index_mirr = mesh_get_x_mirror_vert(ob, NULL, index, topology); if (index_mirr != -1 && index_mirr != index) { @@ -1610,7 +1610,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo int i; bDeformGroup *dg; - if (me->editflag & ME_EDIT_MIRROR_X) { + if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) { BKE_object_defgroup_mirror_selection( ob, defbase_tot, defbase_sel, defbase_sel, &defbase_tot_sel); } @@ -2173,7 +2173,8 @@ static void wpaint_paint_leaves(bContext *C, /* NOTE: current mirroring code cannot be run in parallel */ TaskParallelSettings settings; - BKE_pbvh_parallel_range_settings(&settings, !(me->editflag & ME_EDIT_MIRROR_X), totnode); + BKE_pbvh_parallel_range_settings( + &settings, !(me->flag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY), totnode); switch ((eBrushWeightPaintTool)brush->weightpaint_tool) { case WPAINT_TOOL_AVERAGE: @@ -2291,7 +2292,7 @@ static void wpaint_do_symmetrical_brush_actions( Mesh *me = ob->data; SculptSession *ss = ob->sculpt; StrokeCache *cache = ss->cache; - const char symm = wp->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL; + const char symm = SCULPT_mesh_symmetry_xyz_get(ob); int i = 0; /* initial stroke */ @@ -3311,7 +3312,7 @@ static void vpaint_do_symmetrical_brush_actions( Mesh *me = ob->data; SculptSession *ss = ob->sculpt; StrokeCache *cache = ss->cache; - const char symm = vp->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL; + const char symm = SCULPT_mesh_symmetry_xyz_get(ob); int i = 0; /* initial stroke */ -- cgit v1.2.3