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.

This commit is contained in:
Nicholas Bishop 2009-11-03 22:50:09 +00:00
parent f20b3b3102
commit a4e91f8f1a
6 changed files with 20 additions and 10 deletions

View 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")

View 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()

View 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)

View 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);

View 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

View 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)