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
path: root/source
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-11-04 01:50:09 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2009-11-04 01:50:09 +0300
commita4e91f8f1a820f0c6d063d601ff8042eca13a501 (patch)
tree9f9b032f9e843c36ed577d447b39520f067e8034 /source
parentf20b3b3102f2cdb250b77b06a9d3287efcbc82ba (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/paint.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c6
-rw-r--r--source/blender/makesdna/DNA_scene_types.h10
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c8
4 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 3dfe3966e2f..5cc2190c088 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -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)
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index c2d22089442..c47b83b7e70 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -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);
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index c39712078c2..810b34a746e 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -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
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 5155090b67b..89e29596746 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -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)