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
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2009-08-07 23:16:59 +0400
committerThomas Dinges <blender@dingto.org>2009-08-07 23:16:59 +0400
commit039d4d427bc1d6f5da6c04c2fd5a830087fae6ab (patch)
treea7fa98f1f4eb75111a3160ac28ddf0112050aa43
parent0ce86b0a763e9669a15aa0c07242e6ab2aa8dacd (diff)
2.5 3D View Toolbar:
Brush Panel: * Separated the code for different modes, easier to maintain. * Only settings which are used in the current paint mode are shown now.
-rw-r--r--release/ui/space_view3d_toolbar.py102
-rw-r--r--source/blender/makesrna/intern/rna_brush.c7
2 files changed, 78 insertions, 31 deletions
diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py
index f02089162cb..f207a3d1489 100644
--- a/release/ui/space_view3d_toolbar.py
+++ b/release/ui/space_view3d_toolbar.py
@@ -325,11 +325,16 @@ class VIEW3D_PT_tools_brush(PaintPanel):
settings = self.paint_settings(context)
brush = settings.brush
+ if not context.particle_edit_object:
+ layout.split().row().template_ID(settings, "brush")
+
# Particle Mode #
# XXX This needs a check if psys is editable.
if context.particle_edit_object:
+ # XXX Select Particle System
layout.column().itemR(settings, "tool", expand=True)
+
if settings.tool != 'NONE':
col = layout.column(align=True)
col.itemR(brush, "size", slider=True)
@@ -345,41 +350,53 @@ class VIEW3D_PT_tools_brush(PaintPanel):
layout.itemR(brush, "length_mode", expand=True)
elif settings.tool == 'PUFF':
layout.itemR(brush, "puff_mode", expand=True)
-
- else:
- layout.split().row().template_ID(settings, "brush")
-
- if brush and not context.particle_edit_object:
- if context.sculpt_object:
- layout.column().itemR(brush, "sculpt_tool", expand=True)
- elif context.texture_paint_object:
- col = layout.column(align=True)
- col.item_enumR(settings, "tool", 'DRAW')
- col.item_enumR(settings, "tool", 'SOFTEN')
- if settings.use_projection:
- col.item_enumR(settings, "tool", 'CLONE')
- else:
- col.item_enumR(settings, "tool", 'SMEAR')
+ # Sculpt Mode #
+
+ elif context.sculpt_object:
+ layout.column().itemR(brush, "sculpt_tool", expand=True)
+
+ col = layout.column()
+
+ row = col.row(align=True)
+ row.itemR(brush, "size", slider=True)
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ if brush.sculpt_tool != 'GRAB':
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+ col = layout.column()
+ col.itemR(brush, "airbrush")
+ if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
+ col.itemR(brush, "flip_direction")
+
+ # Texture Paint Mode #
+
+ elif context.texture_paint_object:
+ col = layout.column(align=True)
+ col.item_enumR(settings, "tool", 'DRAW')
+ col.item_enumR(settings, "tool", 'SOFTEN')
+ if settings.use_projection:
+ col.item_enumR(settings, "tool", 'CLONE')
+ else:
+ col.item_enumR(settings, "tool", 'SMEAR')
+
col = layout.column()
- if context.vertex_paint_object or context.texture_paint_object:
- col.itemR(brush, "color", text="")
- elif context.weight_paint_object:
- col.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
+ col.itemR(brush, "color", text="")
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
- col.itemR(brush, "strength", slider=True)
+
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "falloff", slider=True)
row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
- if context.texture_paint_object:
- row = col.row(align=True)
- row.itemR(brush, "clone_opacity", slider=True, text="Opacity")
- row.itemR(brush, "opacity_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
row = col.row(align=True)
row.itemR(brush, "space", text="")
@@ -387,13 +404,40 @@ class VIEW3D_PT_tools_brush(PaintPanel):
rowsub.active = brush.space
rowsub.itemR(brush, "spacing", text="Spacing", slider=True)
rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
-
+
col = layout.column()
col.itemR(brush, "airbrush")
- col.itemR(brush, "anchored")
- col.itemR(brush, "rake")
- if context.sculpt_object and brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
- col.itemR(brush, "flip_direction")
+ sub = col.column()
+ sub.active = brush.airbrush
+ sub.itemR(brush, "rate")
+
+ # Weight Paint Mode #
+
+ elif context.weight_paint_object:
+ layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
+
+ col = layout.column()
+ row = col.row(align=True)
+ row.itemR(brush, "size", slider=True)
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ # Vertex Paint Mode #
+
+ elif context.vertex_paint_object:
+ col = layout.column()
+ col.itemR(brush, "color", text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "size", slider=True)
+ row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+
+ row = col.row(align=True)
+ row.itemR(brush, "strength", slider=True)
+ row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
class VIEW3D_PT_tools_brush_curve(PaintPanel):
__label__ = "Curve"
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 2bb4333365b..4dda4f12d96 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -94,6 +94,7 @@ void rna_def_brush(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+
static EnumPropertyItem prop_blend_items[] = {
{BRUSH_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting."},
{BRUSH_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting."},
@@ -104,11 +105,13 @@ void rna_def_brush(BlenderRNA *brna)
{BRUSH_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."},
{BRUSH_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."},
{0, NULL, 0, NULL, NULL}};
+
static EnumPropertyItem prop_texture_mode_items[] = {
{BRUSH_TEX_DRAG, "TEX_DRAG", 0, "Drag", ""},
{BRUSH_TEX_TILE, "TEX_TILE", 0, "Tile", ""},
{BRUSH_TEX_3D, "TEX_3D", 0, "3D", ""},
{0, NULL, 0, NULL, NULL}};
+
static EnumPropertyItem prop_sculpt_tool_items[] = {
{SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
{SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""},
@@ -182,9 +185,9 @@ void rna_def_brush(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting.");
- prop= RNA_def_property(srna, "opacity_pressure", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "strength_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
- RNA_def_property_ui_text(prop, "Opacity Pressure", "Enable tablet pressure sensitivity for opacity.");
+ RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength.");
prop= RNA_def_property(srna, "size_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);