[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25583] trunk/blender: Change to the way brush/tool selection works, as discussed a while ago

Matt Ebb matt at mke3.net
Mon Dec 28 02:27:05 CET 2009


Revision: 25583
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25583
Author:   broken
Date:     2009-12-28 02:27:05 +0100 (Mon, 28 Dec 2009)

Log Message:
-----------
Change to the way brush/tool selection works, as discussed a while ago

Now, there are preset brushes made for each tool type (eg. for sculpt mode, Grab, 
Draw, Inflate, etc), and the recommended method for changing sculpt tools is to 
change between Brushes. The shortcut keys for changing between tools have 
now been changed to change between named brushes - the G key in sculpt 
mode now changes to any brush named 'Grab'.

The advantages of this are:
* Changing between brushes remembers the strength/size/texture etc settings for 
each brush. This means that for example, you can draw with a strong textured 
Clay brush, but then switch quickly to a weaker, untextured Smooth brush, 
without having to re-do your settings each time.
* You can now add your own custom shortcut keys to your own custom brushes - 
just add a keymap entry similar to the existing ones, that references your own 
custom brush names.

To bring over these new default brushes to an existing B.blend setup, just 
append them in from the new B.blend in svn.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_view3d_toolbar.py
    trunk/blender/source/blender/editors/datafiles/B.blend.c
    trunk/blender/source/blender/editors/include/UI_interface.h
    trunk/blender/source/blender/editors/interface/interface_templates.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
    trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
    trunk/blender/source/blender/makesrna/intern/rna_ui_api.c

Modified: trunk/blender/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d_toolbar.py	2009-12-28 00:55:44 UTC (rev 25582)
+++ trunk/blender/release/scripts/ui/space_view3d_toolbar.py	2009-12-28 01:27:05 UTC (rev 25583)
@@ -498,7 +498,15 @@
         if not context.particle_edit_object:
             col = layout.split().column()
             row = col.row()
-            row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
+            
+            if context.sculpt_object and brush:
+                defaulttools = 8
+            elif context.texture_paint_object and brush:
+                defaulttools = 4
+            else:
+                defaulttools = 2
+            
+            row.template_list(settings, "brushes", settings, "active_brush_index", rows=2, maxrows=defaulttools)
 
             col.template_ID(settings, "brush", new="brush.add")
 
@@ -531,9 +539,7 @@
         elif context.sculpt_object and brush:
             col = layout.column()
             col.separator()
-            col.prop(brush, "sculpt_tool", expand=True)
-            col.separator()
-
+            
             row = col.row(align=True)
             row.prop(brush, "size", slider=True)
             row.prop(brush, "use_size_pressure", toggle=True, text="")
@@ -563,12 +569,6 @@
         # Texture Paint Mode #
 
         elif context.texture_paint_object and brush:
-            col = layout.column(align=True)
-            col.prop_enum(settings, "tool", 'DRAW')
-            col.prop_enum(settings, "tool", 'SOFTEN')
-            col.prop_enum(settings, "tool", 'CLONE')
-            col.prop_enum(settings, "tool", 'SMEAR')
-
             col = layout.column()
             col.prop(brush, "color", text="")
 
@@ -624,7 +624,34 @@
             #row.prop(brush, "jitter", slider=True)
             #row.prop(brush, "use_jitter_pressure", toggle=True, text="")
 
+class VIEW3D_PT_tools_brush_tool(PaintPanel):
+    bl_label = "Tool"
+    bl_default_closed = True
 
+    def poll(self, context):
+        settings = self.paint_settings(context)
+        return (settings and settings.brush and (context.sculpt_object or
+                             context.texture_paint_object))
+
+    def draw(self, context):
+        layout = self.layout
+
+        settings = self.paint_settings(context)
+        brush = settings.brush
+        texture_paint = context.texture_paint_object
+        sculpt = context.sculpt_object
+
+        col = layout.column(align=True)
+        
+        if context.sculpt_object:
+            col.prop(brush, "sculpt_tool", expand=True)
+        elif context.texture_paint_object:
+            col.prop_enum(settings, "tool", 'DRAW')
+            col.prop_enum(settings, "tool", 'SOFTEN')
+            col.prop_enum(settings, "tool", 'CLONE')
+            col.prop_enum(settings, "tool", 'SMEAR')
+
+
 class VIEW3D_PT_tools_brush_stroke(PaintPanel):
     bl_label = "Stroke"
     bl_default_closed = True
@@ -948,6 +975,7 @@
 bpy.types.register(VIEW3D_PT_tools_posemode)
 bpy.types.register(VIEW3D_PT_tools_posemode_options)
 bpy.types.register(VIEW3D_PT_tools_brush)
+bpy.types.register(VIEW3D_PT_tools_brush_tool)
 bpy.types.register(VIEW3D_PT_tools_brush_stroke)
 bpy.types.register(VIEW3D_PT_tools_brush_curve)
 bpy.types.register(VIEW3D_PT_sculpt_options)

Modified: trunk/blender/source/blender/editors/datafiles/B.blend.c
===================================================================
--- trunk/blender/source/blender/editors/datafiles/B.blend.c	2009-12-28 00:55:44 UTC (rev 25582)
+++ trunk/blender/source/blender/editors/datafiles/B.blend.c	2009-12-28 01:27:05 UTC (rev 25583)
@@ -1,2263 +1,2292 @@
 /* DataToC output of file <B_blend> */
 
-int datatoc_B_blend_size= 320520;
+int datatoc_B_blend_size= 337300;
 char datatoc_B_blend[]= {
- 66, 76, 69, 78, 68, 69, 82, 45,
-118, 50, 53, 48, 82, 69, 78, 68, 32,  0,  0,  0,224,237,191, 95,255,127,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  1,  0,  0,  0,
-250,  0,  0,  0, 83, 99,101,110,101,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 71, 76, 79, 66,
- 24,  1,  0,  0,240,236,191, 95,255,127,  0,  0,197,  0,  0,  0,  1,  0,  0,  0, 32, 32, 32, 56,  8,  0,  0,  0,250,  0,  0,  0,
-  1,  0,  0,  1, 32,158,131, 29,  1,  0,  0,  0, 48, 66,136, 27,  1,  0,  0,  0,  0, 16,  0,  0,128, 32,  4,  0, 60,109,101,109,
-111,114,121, 50, 62,  0,  0,  0,  0,  0,  0,  0,178, 38, 29,  1,  1,  0,  0,  0, 40,  0,  0,  0, 48,  0,  0,  0, 32,238,191, 95,
-255,127,  0,  0, 80,237,191, 95,255,127,  0,  0,208,230, 29, 29, 32,  0,  0,  0,224,237,191, 95,255,127,  0,  0,208, 78,111, 27,
-  1,  0,  0,  0, 45,  0,  0,  0,  0,  0,  0,  0,118,  0,  0,  0,  0,  0,  0,  0,192,237,191, 95,255,127,  0,  0, 13,241, 93,  0,
-  1,  0,  0,  0,160,237,191, 95,255,127,  0,  0,224,237,191, 95,255,127,  0,  0, 32,  0,  0,  0, 82, 69, 78, 68,208, 78,111, 27,
-  1,  0,  0,  0, 82, 69, 78, 68, 32,  0,  0,  0,224,237,191, 95,255,127,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0, 16,238,191, 95,
-255,127,  0,  0, 16,238,191, 95,255,127,  0,  0,211,247, 93,  0,  1,  0,  0,  0, 48, 88,131, 27,  1,  0,  0,  0,208, 78,111, 27,
-  1,  0,  0,  0,  1,  0,  0,  0,250,  0,  0,  0, 83, 99,101,110,101,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0, 32,158,131, 29,  1,  0,  0,  0, 87, 77,  0,  0,  8,  1,  0,  0,208, 87,128, 29,  1,  0,  0,  0, 98,  1,  0,  0,
-  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-  0,  0,  0,  0, 87, 77, 87,105,110, 77, 97,110,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,
-  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 16, 89,128, 29,  1,  0,  0,  0, 16, 89,128, 29,  1,  0,  0,  0, 16, 89,128, 29,
-  1,  0,  0,  0, 16, 89,128, 29,  1,  0,  0,  0,  3,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+ 66, 76, 69, 78, 68, 69, 82, 45,118, 50, 53, 48, 82, 69, 78, 68, 32,  0,  0,  0,
+176,231,191, 95,255,127,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  1,  0,  0,  0,250,  0,  0,  0, 83, 99,101,110,101,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 71, 76, 79, 66, 24,  1,  0,  0,192,230,191, 95,255,127,  0,  0,
+198,  0,  0,  0,  1,  0,  0,  0, 32, 32, 49, 49, 11,  0,  0,  0,250,  0,  0,  0,  1,  0,  0,  1,192,100,232, 19,  1,  0,  0,  0,
+ 48,154,  5,  3,  1,  0,  0,  0,  0, 16,  0,  0,128, 32,  4,  0, 47, 85,115,101,114,115, 47,109, 97,116,116, 47, 46, 66, 50, 53,
+ 46, 98,108,101,110,100,  0,  0, 40,  0,  0,  0, 48,  0,  0,  0,240,231,191, 95,255,127,  0,  0, 32,231,191, 95,255,127,  0,  0,
+208,150,170, 28, 32,  0,  0,  0,176,231,191, 95,255,127,  0,  0, 16,119,230,  2,  1,  0,  0,  0, 45,  0,  0,  0,  0,  0,  0,  0,
+118,  0,  0,  0,  0,  0,  0,  0,144,231,191, 95,255,127,  0,  0,209,227, 94,  0,  1,  0,  0,  0,112,231,191, 95,255,127,  0,  0,
+176,231,191, 95,255,127,  0,  0, 32,  0,  0,  0, 82, 69, 78, 68, 16,119,230,  2,  1,  0,  0,  0, 82, 69, 78, 68, 32,  0,  0,  0,
+176,231,191, 95,255,127,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,224,231,191, 95,255,127,  0,  0,224,231,191, 95,255,127,  0,  0,
+151,234, 94,  0,  1,  0,  0,  0, 48,  6,  5,  3,  1,  0,  0,  0, 16,119,230,  2,  1,  0,  0,  0,  1,  0,  0,  0,250,  0,  0,  0,
+ 83, 99,101,110,101,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,192,100,232, 19,  1,  0,  0,  0,
+ 87, 77,  0,  0,  0,  1,  0,  0, 16, 38,231, 19,  1,  0,  0,  0,100,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 87, 77, 87,105,110, 77, 97,110,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+ 96, 39,231, 19,  1,  0,  0,  0, 96, 39,231, 19,  1,  0,  0,  0, 96, 39,231, 19,  1,  0,  0,  0, 96, 39,231, 19,  1,  0,  0,  0,
+  3,  0,  0,  0,  0,  0,  0,  0,176,202,212, 27,  1,  0,  0,  0,240, 51,212, 27,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,160,210,211, 27,  1,  0,  0,  0,160, 32,213, 27,  1,  0,  0,  0,  2,  0,  0,  0,  2,  0,  0,  0,
+  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,144, 89,209, 27,  1,  0,  0,  0,
+144, 89,209, 27,  1,  0,  0,  0,160,187,226, 19,  1,  0,  0,  0,160,187,226, 19,  1,  0,  0,  0,160,187,226, 19,  1,  0,  0,  0,
+192,188,226, 19,  1,  0,  0,  0,192,188,226, 19,  1,  0,  0,  0,192,188,226, 19,  1,  0,  0,  0, 68, 65, 84, 65,224,  0,  0,  0,
+ 96, 39,231, 19,  1,  0,  0,  0,101,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+160,202,226, 19,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0,192,100,232, 19,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+115, 99,114,101,101,110,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,128,  7,128,  4,  0,  0,  0,  0,  1,  0,238,  3,  0,  0,  1,  0,  0,  0,  0,  0, 64,179,230,  2,  1,  0,  0,  0,
+128,109,239, 19,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,128,109, 47, 27,  1,  0,  0,  0,
+ 64,161,212, 27,  1,  0,  0,  0, 64,161,212, 27,  1,  0,  0,  0, 64,100,227, 19,  1,  0,  0,  0,112,101,239, 19,  1,  0,  0,  0,
+ 80,248,192, 24,  1,  0,  0,  0, 80,248,192, 24,  1,  0,  0,  0,128,109,239, 19,  1,  0,  0,  0,176, 91,194, 24,  1,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 83, 78,  0,  0,208,  0,  0,  0,128, 40,231, 19,  1,  0,  0,  0,
+192,  0,  0,  0,  1,  0,  0,  0,  0,211,231, 19,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+  0,  0,  0,  0,  0,  0,  0,  0, 83, 82, 65,110,105,109, 97,116,105,111,110,  0, 46, 48, 48, 49,  0,  0,  0,  0,  0,  0,  0,  0,
+  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,144, 41,231, 19,  1,  0,  0,  0,240, 47,231, 19,  1,  0,  0,  0,
+ 80, 48,231, 19,  1,  0,  0,  0,208, 58,231, 19,  1,  0,  0,  0, 48, 59,231, 19,  1,  0,  0,  0,  0,196,231, 19,  1,  0,  0,  0,

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list