[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29978] branches/soc-2010-jwilkins: * cleaned up stroke panel so that mutually exclusive items are more clearly marked

Jason Wilkins Jason.A.Wilkins at gmail.com
Mon Jul 5 11:39:59 CEST 2010


Revision: 29978
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29978
Author:   jwilkins
Date:     2010-07-05 11:39:59 +0200 (Mon, 05 Jul 2010)

Log Message:
-----------
* cleaned up stroke panel so that mutually exclusive items are more clearly marked

Modified Paths:
--------------
    branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
    branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c

Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-07-05 09:33:17 UTC (rev 29977)
+++ branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-07-05 09:39:59 UTC (rev 29978)
@@ -898,60 +898,88 @@
         col = layout.column()
 
         if context.sculpt_object:
+            col.prop(brush, "stroke_method", expand=True)
 
-           row = col.row()
-           row.prop(brush, "restore_mesh", "Drag Dot")
+            row = col.row()
+            row.active = brush.use_anchor
+            row.label(text="Anchored:")
 
-           col.separator()
+            row = col.row()
+            row.active = brush.use_anchor
+            row.prop(brush, "edge_to_edge", "Edge To Edge")
 
-           row = col.row()
-           row.prop(brush, "use_anchor")
+            col.separator()
 
-           row = col.row()
-           row.active = brush.use_anchor
-           row.prop(brush, "edge_to_edge", "Edge To Edge")
+            row = col.row()
+            row.active = brush.use_airbrush
+            row.label(text="Airbrush:")
 
-           col.separator()
+            row = col.row()
+            row.active = brush.use_airbrush
+            row.prop(brush, "rate", text="Rate", slider=True)
 
-        row = col.row()
-        row.prop(brush, "use_airbrush")
+            col.separator()
 
-        row = col.row()
-        row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
-        row.prop(brush, "rate", slider=True)
-
-        col.separator()
-
-        if not texture_paint:
             row = col.row()
-            row.prop(brush, "use_smooth_stroke")
+            row.active = brush.use_smooth_stroke
+            row.label(text="Smooth Stroke:")
 
             col = layout.column()
             col.active = brush.use_smooth_stroke
             col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
             col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
 
-        col.separator()
+            col.separator()
 
-        col = layout.column()
-        col.active = (not brush.use_anchor) and (brush.sculpt_tool not in ('GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'))
+            col = layout.column()
 
-        row = col.row()
-        row.prop(brush, "use_space")
+            row = col.row()
+            row.active = brush.use_space
+            row.label(text="Space:")
 
-        row = col.row()
-        row.active = brush.use_space
-        row.prop(brush, "spacing", text="Spacing", slider=True)
+            row = col.row()
+            row.active = brush.use_space
+            row.prop(brush, "spacing", text="Spacing", slider=True)
+        else:
+            row = col.row()
+            row.prop(brush, "use_airbrush")
 
-        #col.prop(brush, "use_space_atten", text="Adaptive Strength")
-        #col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
+            row = col.row()
+            row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
+            row.prop(brush, "rate", slider=True)
 
-        #col.separator()
+            col.separator()
 
-        #if texture_paint:
-        #    row.prop(brush, "use_spacing_pressure", toggle=True, text="")
+            if not texture_paint:
+                row = col.row()
+                row.prop(brush, "use_smooth_stroke")
 
+                col = layout.column()
+                col.active = brush.use_smooth_stroke
+                col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+                col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
 
+            col.separator()
+
+            col = layout.column()
+            col.active = (not brush.use_anchor) and (brush.sculpt_tool not in ('GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'))
+
+            row = col.row()
+            row.prop(brush, "use_space")
+
+            row = col.row()
+            row.active = brush.use_space
+            row.prop(brush, "spacing", text="Spacing", slider=True)
+
+            #col.prop(brush, "use_space_atten", text="Adaptive Strength")
+            #col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
+
+            #col.separator()
+
+            #if texture_paint:
+            #    row.prop(brush, "use_spacing_pressure", toggle=True, text="")
+
+
 class VIEW3D_PT_tools_brush_curve(PaintPanel):
     bl_label = "Curve"
     bl_default_closed = True

Modified: branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c	2010-07-05 09:33:17 UTC (rev 29977)
+++ branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c	2010-07-05 09:39:59 UTC (rev 29978)
@@ -139,6 +139,15 @@
 	//	{STROKE_TOOL_ANCHORED, "ANCHORED", 0, "Anchored", ""},
 	//	{0, NULL, 0, NULL, NULL}};
 
+	static EnumPropertyItem brush_stroke_method_items[] = {
+		{0, "DOTS", 0, "Dots", ""},
+		{BRUSH_RESTORE_MESH, "DRAG_DOT", 0, "Drag Dot", ""},
+		{BRUSH_SPACE, "SPACE", 0, "Space", ""},
+		{BRUSH_SMOOTH_STROKE, "SMOOTH_STROKE", 0, "Smooth", ""},
+		{BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", ""},
+		{BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", ""},
+		{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"},
@@ -241,6 +250,12 @@
 	RNA_def_property_ui_text(prop, "Direction", "");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 	
+	prop= RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+	RNA_def_property_enum_items(prop, brush_stroke_method_items);
+	RNA_def_property_ui_text(prop, "Stroke Method", "");
+	RNA_def_property_update(prop, 0, "rna_Brush_update");
+
 	prop= RNA_def_property(srna, "flatten_contrast", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
 	RNA_def_property_enum_items(prop, prop_flatten_contrast_items);





More information about the Bf-blender-cvs mailing list