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:
authorCampbell Barton <ideasman42@gmail.com>2018-06-19 09:35:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-19 09:50:35 +0300
commit751189e9d6828368614fe3f517a80ddb95f8c547 (patch)
tree4614bb398879b223a1c1a706b31ab13c3b089a88 /source/blender/editors/sculpt_paint/sculpt.c
parentf0c6f5ee77f3739658e33a7e8995bca381a7afeb (diff)
Vertex Paint: set sculpt object mode immediately
SculptSession.mode_type wasn't initialized until painting, making it unreliable for checks in other parts of the code. Also remove unnecessary initialization, matching sculpt mode more closely.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index bef705a29b1..280e22084cc 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4804,7 +4804,7 @@ static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession
sculpt_update_tex(scene, sd, ss);
}
-static bool sculpt_brush_stroke_init(bContext *C, wmOperator *op)
+static void sculpt_brush_stroke_init(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
@@ -4824,8 +4824,6 @@ static bool sculpt_brush_stroke_init(bContext *C, wmOperator *op)
is_smooth = sculpt_any_smooth_mode(brush, NULL, mode);
BKE_sculpt_update_mesh_elements(scene, sd, ob, is_smooth, need_mask);
-
- return 1;
}
static void sculpt_restore_mesh(Sculpt *sd, Object *ob)
@@ -5069,8 +5067,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent
int ignore_background_click;
int retval;
- if (!sculpt_brush_stroke_init(C, op))
- return OPERATOR_CANCELLED;
+ sculpt_brush_stroke_init(C, op);
stroke = paint_stroke_new(C, op, sculpt_stroke_get_location,
sculpt_stroke_test_start,
@@ -5102,8 +5099,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent
static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
{
- if (!sculpt_brush_stroke_init(C, op))
- return OPERATOR_CANCELLED;
+ sculpt_brush_stroke_init(C, op);
op->customdata = paint_stroke_new(C, op, sculpt_stroke_get_location, sculpt_stroke_test_start,
sculpt_stroke_update_step, NULL, sculpt_stroke_done, 0);