From 645c2bd4d002d685cf240d6a46c635c00c0c1706 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Fri, 27 Nov 2020 01:42:24 +0100 Subject: Fix sculpt transform incorrently flipping displacement in Y and Z axis These functions were only checking the X axis for flipping the displacement for a symmetry area depending on the initial position of the pivot. This affects transform and any other tools that transform vertices and applies symmetry based on areas (the pose brush, for example). Reviewed By: sergey Differential Revision: https://developer.blender.org/D9654 --- source/blender/editors/sculpt_paint/sculpt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/sculpt_paint/sculpt.c') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 1ddfa0b9b17..b9427677745 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4025,13 +4025,13 @@ void SCULPT_flip_v3_by_symm_area(float v[3], const ePaintSymmetryAreas symmarea, const float pivot[3]) { - for (char i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { ePaintSymmetryFlags symm_it = 1 << i; if (symm & symm_it) { if (symmarea & symm_it) { flip_v3(v, symm_it); } - if (pivot[0] < 0) { + if (pivot[i] < 0.0f) { flip_v3(v, symm_it); } } @@ -4043,13 +4043,13 @@ void SCULPT_flip_quat_by_symm_area(float quat[3], const ePaintSymmetryAreas symmarea, const float pivot[3]) { - for (char i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { ePaintSymmetryFlags symm_it = 1 << i; if (symm & symm_it) { if (symmarea & symm_it) { flip_qt(quat, symm_it); } - if (pivot[0] < 0) { + if (pivot[i] < 0.0f) { flip_qt(quat, symm_it); } } -- cgit v1.2.3