Sculpt UI
authorWilliam Reynish <william@reynish.com>
Sun, 13 Sep 2009 19:37:51 +0000 (19:37 +0000)
committerWilliam Reynish <william@reynish.com>
Sun, 13 Sep 2009 19:37:51 +0000 (19:37 +0000)
*Changed Sculpt Modes Flip Direction to an enum so that you can explicitly choose Add or Subtract.
*Expanded the sculpt tool list. I realize Nicolas has a longer term plan for the brush tools, but at least now it's useable again.

release/ui/space_view3d_toolbar.py
source/blender/makesrna/intern/rna_brush.c

index 9dd2df14492c2b865feb7df304d8be0a5e8b8152..40ebb6883f0da6918db055dd3d18b4440a68b988 100644 (file)
@@ -399,7 +399,9 @@ class VIEW3D_PT_tools_brush(PaintPanel):
                elif context.sculpt_object and settings.brush:
                        col = layout.column()
                        col.itemS()
-                               
+                       col.itemR(brush, "sculpt_tool", expand=True)
+                       col.itemS()
+                       
                        row = col.row(align=True)
                        row.itemR(brush, "size", slider=True)
                        row.itemR(brush, "size_pressure", toggle=True, text="")
@@ -412,13 +414,13 @@ class VIEW3D_PT_tools_brush(PaintPanel):
                                col = layout.column()
 
                                if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
-                                       col.itemR(brush, "flip_direction")
+                                       col.row().itemR(brush, "direction", expand=True)
 
                                if brush.sculpt_tool == 'LAYER':
                                        col.itemR(brush, "persistent")
                                        col.itemO("sculpt.set_persistent_base")
 
-                       col.itemR(brush, "sculpt_tool")
+                       
                                
                # Texture Paint Mode #
                
index 448a204685544d0b4046de185415d3d7563f1fda..612863e1ab9c78862e03fcf28c5521bf84724cd8 100644 (file)
@@ -104,6 +104,11 @@ void rna_def_brush(BlenderRNA *brna)
                {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."},
                {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."},
                {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"},
+               {0, NULL, 0, NULL, NULL}};
                
        srna= RNA_def_struct(brna, "Brush", "ID");
        RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting.");
@@ -117,6 +122,11 @@ void rna_def_brush(BlenderRNA *brna)
        prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, brush_sculpt_tool_items);
        RNA_def_property_ui_text(prop, "Sculpt Tool", "");
+
+       prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+       RNA_def_property_enum_items(prop, prop_flip_direction_items);
+       RNA_def_property_ui_text(prop, "Direction", "Mapping type to use for this image in the game engine.");
        
        /* number values */
        prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
@@ -192,10 +202,6 @@ void rna_def_brush(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED);
        RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location.");
 
-       prop= RNA_def_property(srna, "flip_direction", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_DIR_IN);
-       RNA_def_property_ui_text(prop, "Flip Direction", "Move vertices in the opposite direction.");
-
        prop= RNA_def_property(srna, "space", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE);
        RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing.");