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:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-05-14 16:32:15 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-05-14 16:32:15 +0400
commitda7f7007494746da8a71982bb0d78a082e07118f (patch)
treebb5053b649d124b7ad0ea22433e968df9cb0bf44 /source/blender
parent28608b92814f1b44b74e8f3b72483aa4f61c0446 (diff)
Fix #27390: Shift for activating Smooth Brush broken in sculpt
Smooth brushes at requires face map which haven't used to be created for simple meshes (without modifiers). Use corrected need_fmap flag at stroke initialization, so face map is created properly for "temporary" smooth brushes and simple meshes.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 00607d66049..09e46119dbe 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3287,18 +3287,23 @@ static void sculpt_brush_init_tex(Sculpt *sd, SculptSession *ss)
sculpt_update_tex(sd, ss);
}
-static int sculpt_brush_stroke_init(bContext *C, ReportList *UNUSED(reports))
+static int sculpt_brush_stroke_init(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C);
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
SculptSession *ss = CTX_data_active_object(C)->sculpt;
Brush *brush = paint_brush(&sd->paint);
+ int mode= RNA_enum_get(op->ptr, "mode");
+ int is_smooth= 0;
view3d_operator_needs_opengl(C);
sculpt_brush_init_tex(sd, ss);
- sculpt_update_mesh_elements(scene, sd, ob, brush->sculpt_tool == SCULPT_TOOL_SMOOTH);
+ is_smooth|= mode == BRUSH_STROKE_SMOOTH;
+ is_smooth|= brush->sculpt_tool == SCULPT_TOOL_SMOOTH;
+
+ sculpt_update_mesh_elements(scene, sd, ob, is_smooth);
return 1;
}
@@ -3514,7 +3519,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even
struct PaintStroke *stroke;
int ignore_background_click;
- if(!sculpt_brush_stroke_init(C, op->reports))
+ if(!sculpt_brush_stroke_init(C, op))
return OPERATOR_CANCELLED;
stroke = paint_stroke_new(C, sculpt_stroke_get_location,
@@ -3543,7 +3548,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even
static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
{
- if(!sculpt_brush_stroke_init(C, op->reports))
+ if(!sculpt_brush_stroke_init(C, op))
return OPERATOR_CANCELLED;
op->customdata = paint_stroke_new(C, sculpt_stroke_get_location, sculpt_stroke_test_start,