[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24288] branches/sculpt25: Moved the show brush flag from sculpt to paint, and it now shows/ hides the brush as expected.
Nicholas Bishop
nicholasbishop at gmail.com
Tue Nov 3 23:50:09 CET 2009
Revision: 24288
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24288
Author: nicholasbishop
Date: 2009-11-03 23:50:09 +0100 (Tue, 03 Nov 2009)
Log Message:
-----------
Moved the show brush flag from sculpt to paint, and it now shows/hides the brush as expected. Also fixed some errors in the UI scripts.
Modified Paths:
--------------
branches/sculpt25/release/scripts/ui/space_view3d.py
branches/sculpt25/release/scripts/ui/space_view3d_toolbar.py
branches/sculpt25/source/blender/blenkernel/intern/paint.c
branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c
branches/sculpt25/source/blender/makesdna/DNA_scene_types.h
branches/sculpt25/source/blender/makesrna/intern/rna_sculpt_paint.c
Modified: branches/sculpt25/release/scripts/ui/space_view3d.py
===================================================================
--- branches/sculpt25/release/scripts/ui/space_view3d.py 2009-11-03 22:07:15 UTC (rev 24287)
+++ branches/sculpt25/release/scripts/ui/space_view3d.py 2009-11-03 22:50:09 UTC (rev 24288)
@@ -633,7 +633,8 @@
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")
Modified: branches/sculpt25/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- branches/sculpt25/release/scripts/ui/space_view3d_toolbar.py 2009-11-03 22:07:15 UTC (rev 24287)
+++ branches/sculpt25/release/scripts/ui/space_view3d_toolbar.py 2009-11-03 22:50:09 UTC (rev 24288)
@@ -663,7 +663,6 @@
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()
Modified: branches/sculpt25/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/sculpt25/source/blender/blenkernel/intern/paint.c 2009-11-03 22:07:15 UTC (rev 24287)
+++ branches/sculpt25/source/blender/blenkernel/intern/paint.c 2009-11-03 22:50:09 UTC (rev 24288)
@@ -175,6 +175,8 @@
memcpy(p->paint_cursor_col, col, 3);
p->paint_cursor_col[3] = 128;
+
+ p->flags |= PAINT_SHOW_BRUSH;
}
void free_paint(Paint *paint)
Modified: branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c 2009-11-03 22:07:15 UTC (rev 24287)
+++ branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c 2009-11-03 22:50:09 UTC (rev 24288)
@@ -101,8 +101,12 @@
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);
glEnable(GL_BLEND);
Modified: branches/sculpt25/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/sculpt25/source/blender/makesdna/DNA_scene_types.h 2009-11-03 22:07:15 UTC (rev 24287)
+++ branches/sculpt25/source/blender/makesdna/DNA_scene_types.h 2009-11-03 22:50:09 UTC (rev 24288)
@@ -481,7 +481,7 @@
void *paint_cursor;
unsigned char paint_cursor_col[4];
- int pad;
+ int flags;
} Paint;
typedef struct ImagePaintSettings {
@@ -1046,13 +1046,17 @@
#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
Modified: branches/sculpt25/source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
--- branches/sculpt25/source/blender/makesrna/intern/rna_sculpt_paint.c 2009-11-03 22:07:15 UTC (rev 24287)
+++ branches/sculpt25/source/blender/makesrna/intern/rna_sculpt_paint.c 2009-11-03 22:50:09 UTC (rev 24288)
@@ -170,6 +170,10 @@
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 @@
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)
More information about the Bf-blender-cvs
mailing list