Revision: 36687
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36687
Author:   nazgul
Date:     2011-05-14 12:32:15 +0000 (Sat, 14 May 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c  2011-05-14 
10:35:11 UTC (rev 36686)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c  2011-05-14 
12:32:15 UTC (rev 36687)
@@ -3287,19 +3287,24 @@
        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 @@
        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_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,

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to