Moved the show brush flag from sculpt to paint, and it now shows/hides the brush...
authorNicholas Bishop <nicholasbishop@gmail.com>
Tue, 3 Nov 2009 22:50:09 +0000 (22:50 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Tue, 3 Nov 2009 22:50:09 +0000 (22:50 +0000)
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
source/blender/blenkernel/intern/paint.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_sculpt_paint.c

index ac65a3dae45a4ad7a93ed323034a58b707737932..2670f6643d3bdab55b95bd382895a8cffded8bb2 100644 (file)
@@ -633,7 +633,8 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
                 layout.itemR(brush, "use_anchor")
 
             if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
-                layout.itemR(brush, "flip_direction")
+                layout.item_enumR(brush, "direction", value="SUBTRACT")
+                layout.item_enumR(brush, "direction", value="ADD")
 
             if brush.sculpt_tool == 'LAYER':
                 layout.itemR(brush, "use_persistent")
index 73f613177b8b6ac41ac7dbd8162f8995d6faeb46..5b773aac13357345b08a3e2f0ddf64ed01fbac58 100644 (file)
@@ -663,7 +663,6 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
         sculpt = context.tool_settings.sculpt
 
         col = layout.column()
-        col.itemR(sculpt, "partial_redraw", text="Partial Refresh")
         col.itemR(sculpt, "show_brush")
 
         split = self.layout.split()
index 3dfe3966e2fe1ef2ac0c3f3068e3888cebd5f3da..5cc2190c08879b43f9048884385792dc76e3f1e4 100644 (file)
@@ -175,6 +175,8 @@ void paint_init(Paint *p, const char col[3])
 
        memcpy(p->paint_cursor_col, col, 3);
        p->paint_cursor_col[3] = 128;
+
+       p->flags |= PAINT_SHOW_BRUSH;
 }
 
 void free_paint(Paint *paint)
index c2d2208944207f572c70db4fab12c92dde5485de..c47b83b7e70f75142a8e188fbedf5b394c5d2a31 100644 (file)
@@ -101,7 +101,11 @@ static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata
 
 static void paint_draw_cursor(bContext *C, int x, int y, void *customdata)
 {
-       Brush *brush = paint_brush(paint_get_active(CTX_data_scene(C)));
+       Paint *paint = paint_get_active(CTX_data_scene(C));
+       Brush *brush = paint_brush(paint);
+
+       if(!(paint->flags & PAINT_SHOW_BRUSH))
+               return;
 
        glColor4ubv(paint_get_active(CTX_data_scene(C))->paint_cursor_col);
        glEnable(GL_LINE_SMOOTH);
index c39712078c2c7d884592a7e2ea23fd179814eebe..810b34a746eba37d8e8b7d46fe0c7393ea508508 100644 (file)
@@ -481,7 +481,7 @@ typedef struct Paint {
        void *paint_cursor;
        unsigned char paint_cursor_col[4];
 
-       int pad;
+       int flags;
 } Paint;
 
 typedef struct ImagePaintSettings {
@@ -1046,13 +1046,17 @@ typedef struct Scene {
 #define FFMPEG_MULTIPLEX_AUDIO  1
 #define FFMPEG_AUTOSPLIT_OUTPUT 2
 
+/* Paint.flags */
+typedef enum {
+       PAINT_SHOW_BRUSH = 1
+} PaintFlags;
+
 /* Sculpt.flags */
+/* These can eventually be moved to paint flags? */
 typedef enum SculptFlags {
        SCULPT_SYMM_X = 1,
        SCULPT_SYMM_Y = 2,
        SCULPT_SYMM_Z = 4,
-       SCULPT_INPUT_SMOOTH = 8,
-       SCULPT_DRAW_BRUSH = 32,
        SCULPT_LOCK_X = 64,
        SCULPT_LOCK_Y = 128,
        SCULPT_LOCK_Z = 256
index 5155090b67becfcc5aad26c8f2b3fc57d0afd1ba..89e295967466b5962ef8539b9d74d3b09da2c930 100644 (file)
@@ -170,6 +170,10 @@ static void rna_def_paint(BlenderRNA *brna)
        RNA_def_property_pointer_funcs(prop, "rna_Paint_active_brush_get", "rna_Paint_active_brush_set", NULL);
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Brush", "Active paint brush.");
+
+       prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
+       RNA_def_property_ui_text(prop, "Show Brush", "");
 }
 
 static void rna_def_sculpt(BlenderRNA  *brna)
@@ -203,10 +207,6 @@ static void rna_def_sculpt(BlenderRNA  *brna)
        prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
        RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices.");
-
-       prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DRAW_BRUSH);
-       RNA_def_property_ui_text(prop, "Show Brush", "");
 }
 
 static void rna_def_vertex_paint(BlenderRNA *brna)