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:
authorPablo Dobarro <pablodp606@gmail.com>2020-06-30 22:53:48 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-07-01 20:03:22 +0300
commit6358c7754c322919368aef9580bfa5b9a0fa0b60 (patch)
treee316385b97fc0d7bee0f593164523a2999e30c57 /source/blender/editors/sculpt_paint/paint_cursor.c
parentbf5a656ff6840bdaf911abf5692271845377e2d9 (diff)
Cleanup: Add functions to check the first brush step and symmetry passes
This adds three functions to check the state of the stroke in the StrokeCache, removing the references to first_time and mirror_symmetry_pass from the code. This makes easier to understand what each code path is doing inside of each tool. Some tools were using mirror_symmetry_pass incorrectly, so this should also fix unreported bugs with radial and tiling symmetry related to that. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8164
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 1291de04634..909eae64e72 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1567,7 +1567,8 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
}
}
else {
- if (vc.obact->sculpt->cache && !vc.obact->sculpt->cache->first_time) {
+ if (vc.obact->sculpt->cache &&
+ !SCULPT_stroke_is_first_brush_step_of_symmetry_pass(vc.obact->sculpt->cache)) {
wmViewport(&region->winrct);
/* Draw cached dynamic mesh preview lines. */
@@ -1593,7 +1594,8 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
}
if (brush->sculpt_tool == SCULPT_TOOL_MULTIPLANE_SCRAPE &&
- brush->flag2 & BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW && !ss->cache->first_time) {
+ brush->flag2 & BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW &&
+ !SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache)) {
GPU_matrix_push_projection();
ED_view3d_draw_setup_view(wm,
CTX_wm_window(C),
@@ -1611,7 +1613,8 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
GPU_matrix_pop_projection();
}
- if (brush->sculpt_tool == SCULPT_TOOL_CLOTH && !ss->cache->first_time) {
+ if (brush->sculpt_tool == SCULPT_TOOL_CLOTH &&
+ !SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache)) {
GPU_matrix_push_projection();
ED_view3d_draw_setup_view(CTX_wm_manager(C),
CTX_wm_window(C),