Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index f45c244f675..34d6f1d532b 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -769,8 +769,8 @@ static void do_weight_paint_vertex_single(
MDeformVert *dv_mirr;
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_VERTEX_GROUPS_X_SYMMETRY) {
+ /* Check if we should mirror vertex groups (X-axis). */
+ if ((me->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) && (me->symmetry & ME_SYMMETRY_X)) {
index_mirr = mesh_get_x_mirror_vert(ob, NULL, index, topology);
vgroup_mirr = wpi->mirror.index;
@@ -979,8 +979,8 @@ static void do_weight_paint_vertex_multi(
float curw, curw_real, oldw, neww, change, curw_mirr, change_mirr;
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_VERTEX_GROUPS_X_SYMMETRY) {
+ /* Check if we should mirror vertex groups (X-axis). */
+ if ((me->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) && (me->symmetry & ME_SYMMETRY_X)) {
index_mirr = mesh_get_x_mirror_vert(ob, NULL, index, topology);
if (!ELEM(index_mirr, -1, index)) {
@@ -1629,7 +1629,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
int i;
bDeformGroup *dg;
- if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) {
+ if ((me->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) && (me->symmetry & ME_SYMMETRY_X)) {
BKE_object_defgroup_mirror_selection(
ob, defbase_tot, defbase_sel, defbase_sel, &defbase_tot_sel);
}
@@ -2195,7 +2195,8 @@ static void wpaint_paint_leaves(bContext *C,
/* NOTE: current mirroring code cannot be run in parallel */
TaskParallelSettings settings;
- const bool use_threading = ((me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) == 0);
+ const bool use_threading = !((me->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) &&
+ (me->symmetry & ME_SYMMETRY_X));
BKE_pbvh_parallel_range_settings(&settings, use_threading, totnode);
switch ((eBrushWeightPaintTool)brush->weightpaint_tool) {
@@ -2326,6 +2327,13 @@ static void wpaint_do_symmetrical_brush_actions(
cache->symmetry = symm;
+ if (me->editflag & ME_EDIT_MIRROR_VERTEX_GROUPS) {
+ /* We don't do any symmetry strokes when mirroing vertex groups. */
+ copy_v3_v3(cache->true_last_location, cache->true_location);
+ cache->is_last_valid = true;
+ return;
+ }
+
/* symm is a bit combination of XYZ - 1 is mirror
* X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
for (i = 1; i <= symm; i++) {