diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-18 20:58:48 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-18 20:58:58 +0300 |
commit | 5502517c3c12086c111ae5477fae9c0d2eb8a84c (patch) | |
tree | 07a1978b5b81b5c1679a002111457acf73561a37 /source/blender/editors/sculpt_paint/sculpt.c | |
parent | 827dfd76dddec962e67825815931d4f2953c741b (diff) |
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
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index a577760cf9b..0b4f853b677 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -296,6 +296,12 @@ float *SCULPT_brush_deform_target_vertex_co_get(SculptSession *ss, return iter->co; } +char SCULPT_mesh_symmetry_xyz_get(Object *object) +{ + const Mesh *mesh = BKE_mesh_from_object(object); + return mesh->symmetry; +} + /* Sculpt Face Sets and Visibility. */ int SCULPT_active_face_set_get(SculptSession *ss) @@ -1057,7 +1063,7 @@ void SCULPT_floodfill_add_initial_with_symmetry( Sculpt *sd, Object *ob, SculptSession *ss, SculptFloodFill *flood, int index, float radius) { /* Add active vertex and symmetric vertices to the queue. */ - const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL; + const char symm = SCULPT_mesh_symmetry_xyz_get(ob); for (char i = 0; i <= symm; ++i) { if (SCULPT_is_symmetry_iteration_valid(i, symm)) { int v = -1; @@ -1081,7 +1087,7 @@ void SCULPT_floodfill_add_active( Sculpt *sd, Object *ob, SculptSession *ss, SculptFloodFill *flood, float radius) { /* Add active vertex and symmetric vertices to the queue. */ - const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL; + const char symm = SCULPT_mesh_symmetry_xyz_get(ob); for (char i = 0; i <= symm; ++i) { if (SCULPT_is_symmetry_iteration_valid(i, symm)) { int v = -1; @@ -6247,7 +6253,7 @@ static void do_symmetrical_brush_actions(Sculpt *sd, Brush *brush = BKE_paint_brush(&sd->paint); SculptSession *ss = ob->sculpt; StrokeCache *cache = ss->cache; - const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL; + const char symm = SCULPT_mesh_symmetry_xyz_get(ob); float feather = calc_symmetry_feather(sd, ss->cache); |