diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-20 11:30:40 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-20 11:30:40 +0300 |
commit | 02ca0fda8ea86c5b5b05b8d1ef6cc81e8f280523 (patch) | |
tree | 37fc44b7dab5951dbaa6c45899be99178df6b210 /source/blender/makesrna/intern | |
parent | e8b123a1e46270de28c00d87dba8fd4c1ca2a416 (diff) |
Moved the image paint tool and the vertex/weight paint tool (blend mode?)
to the Brush data. This now works the same way as sculpt, with named
preset brushes that retain settings.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 49 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 28 |
2 files changed, 40 insertions, 37 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 8f8dd4681ab..152e92eb406 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -35,17 +35,6 @@ #include "IMB_imbuf.h" #include "WM_types.h" -EnumPropertyItem brush_sculpt_tool_items[] = { - {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""}, - {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""}, - {SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", ""}, - {SCULPT_TOOL_INFLATE, "INFLATE", 0, "Inflate", ""}, - {SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", ""}, - {SCULPT_TOOL_LAYER, "LAYER", 0, "Layer", ""}, - {SCULPT_TOOL_FLATTEN, "FLATTEN", 0, "Flatten", ""}, - {SCULPT_TOOL_CLAY, "CLAY", 0, "Clay", ""}, - {0, NULL, 0, NULL, NULL}}; - #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" @@ -121,6 +110,34 @@ static void rna_def_brush(BlenderRNA *brna) {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem brush_sculpt_tool_items[] = { + {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""}, + {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""}, + {SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", ""}, + {SCULPT_TOOL_INFLATE, "INFLATE", 0, "Inflate", ""}, + {SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", ""}, + {SCULPT_TOOL_LAYER, "LAYER", 0, "Layer", ""}, + {SCULPT_TOOL_FLATTEN, "FLATTEN", 0, "Flatten", ""}, + {SCULPT_TOOL_CLAY, "CLAY", 0, "Clay", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem brush_vertexpaint_tool_items[] = { + {0, "MIX", 0, "Mix", "Use mix blending mode while painting."}, + {1, "ADD", 0, "Add", "Use add blending mode while painting."}, + {2, "SUB", 0, "Subtract", "Use subtract blending mode while painting."}, + {3, "MUL", 0, "Multiply", "Use multiply blending mode while painting."}, + {4, "BLUR", 0, "Blur", "Blur the color with surrounding values"}, + {5, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."}, + {6, "DARKEN", 0, "Darken", "Use darken blending mode while painting."}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem brush_imagepaint_tool_items[] = { + {PAINT_TOOL_DRAW, "DRAW", 0, "Draw", ""}, + {PAINT_TOOL_SOFTEN, "SOFTEN", 0, "Soften", ""}, + {PAINT_TOOL_SMEAR, "SMEAR", 0, "Smear", ""}, + {PAINT_TOOL_CLONE, "CLONE", 0, "Clone", ""}, + {0, NULL, 0, NULL, NULL}}; + static const EnumPropertyItem prop_flip_direction_items[]= { {0, "ADD", 0, "Add", "Add effect of brush"}, {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, @@ -140,6 +157,16 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_enum_items(prop, brush_sculpt_tool_items); RNA_def_property_ui_text(prop, "Sculpt Tool", ""); RNA_def_property_update(prop, 0, "rna_Brush_update"); + + prop= RNA_def_property(srna, "vertexpaint_tool", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, brush_vertexpaint_tool_items); + RNA_def_property_ui_text(prop, "Vertex/Weight Paint Tool", ""); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + + prop= RNA_def_property(srna, "imagepaint_tool", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, brush_imagepaint_tool_items); + RNA_def_property_ui_text(prop, "Image Paint Tool", ""); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 5d81ec2c572..462ba5c256f 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -277,23 +277,10 @@ static void rna_def_vertex_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem brush_mode_items[] = { - {0, "MIX", 0, "Mix", "Use mix blending mode while painting."}, - {1, "ADD", 0, "Add", "Use add blending mode while painting."}, - {2, "SUB", 0, "Subtract", "Use subtract blending mode while painting."}, - {3, "MUL", 0, "Multiply", "Use multiply blending mode while painting."}, - {4, "BLUR", 0, "Blur", "Blur the color with surrounding values"}, - {5, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."}, - {6, "DARKEN", 0, "Darken", "Use darken blending mode while painting."}, - {0, NULL, 0, NULL, NULL}}; - + srna= RNA_def_struct(brna, "VertexPaint", "Paint"); RNA_def_struct_sdna(srna, "VPaint"); RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode."); - - prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, brush_mode_items); - RNA_def_property_ui_text(prop, "Brush Mode", "Mode in which color is painted."); prop= RNA_def_property(srna, "all_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA); @@ -312,22 +299,11 @@ static void rna_def_image_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - - static EnumPropertyItem tool_items[] = { - {PAINT_TOOL_DRAW, "DRAW", 0, "Draw", ""}, - {PAINT_TOOL_SOFTEN, "SOFTEN", 0, "Soften", ""}, - {PAINT_TOOL_SMEAR, "SMEAR", 0, "Smear", ""}, - {PAINT_TOOL_CLONE, "CLONE", 0, "Clone", ""}, - {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ImagePaint", "Paint"); RNA_def_struct_sdna(srna, "ImagePaintSettings"); RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode."); - - prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, tool_items); - RNA_def_property_ui_text(prop, "Tool", ""); - + /* booleans */ prop= RNA_def_property(srna, "show_brush_draw", PROP_BOOLEAN, PROP_NONE); |