Revision: 22670
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22670
Author:   nicholasbishop
Date:     2009-08-21 08:23:38 +0200 (Fri, 21 Aug 2009)

Log Message:
-----------
2.5/Paint:

* Updated texture paint UI for stroke settings.
* Removed duplicate brush blend types, just use the ones defined in imbuf 
instead

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/space_view3d_toolbar.py
    
branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c
    branches/blender2.5/blender/source/blender/makesdna/DNA_brush_types.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c

Modified: branches/blender2.5/blender/release/ui/space_view3d_toolbar.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_view3d_toolbar.py      
2009-08-21 03:09:27 UTC (rev 22669)
+++ branches/blender2.5/blender/release/ui/space_view3d_toolbar.py      
2009-08-21 06:23:38 UTC (rev 22670)
@@ -369,7 +369,7 @@
                                
                        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="")
@@ -382,18 +382,7 @@
                        row.itemR(brush, "falloff", slider=True)
                        row.itemR(brush, "falloff_pressure", toggle=True, 
icon='ICON_BRUSH_DATA', text="")
                        
-                       row = col.row(align=True)
-                       row.itemR(brush, "space", text="")
-                       rowsub = row.row(align=True)
-                       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")
-                       sub = col.column()
-                       sub.active = brush.airbrush
-                       sub.itemR(brush, "rate")
+                       col.itemR(brush, "blend")
                
                # Weight Paint Mode #
        
@@ -431,23 +420,28 @@
                settings = self.paint_settings(context)
                return (settings and settings.brush and (context.sculpt_object 
or
                                                         
context.vertex_paint_object or
-                                                        
context.weight_paint_object))
+                                                        
context.weight_paint_object or
+                                                        
context.texture_paint_object))
 
        def draw(self, context):
                settings = self.paint_settings(context)
                brush = settings.brush
+               texture_paint = context.texture_paint_object
                layout = self.layout
 
-               layout.itemR(brush, "smooth_stroke")
-               col = layout.column()
-               col.active = brush.smooth_stroke
-               col.itemR(brush, "smooth_stroke_radius", text="Radius", 
slider=True)
-               col.itemR(brush, "smooth_stroke_factor", text="Factor", 
slider=True)
+               if not texture_paint:
+                       layout.itemR(brush, "smooth_stroke")
+                       col = layout.column()
+                       col.active = brush.smooth_stroke
+                       col.itemR(brush, "smooth_stroke_radius", text="Radius", 
slider=True)
+                       col.itemR(brush, "smooth_stroke_factor", text="Factor", 
slider=True)
 
                layout.itemR(brush, "space")
-               col = layout.column()
-               col.active = brush.space
-               col.itemR(brush, "spacing", text="Distance", slider=True)
+               row = layout.row(align=True)
+               row.active = brush.space
+               row.itemR(brush, "spacing", text="Distance", slider=True)
+               if texture_paint:
+                       row.itemR(brush, "spacing_pressure", toggle=True, 
icon='ICON_BRUSH_DATA', text="")
 
                layout.itemR(brush, "airbrush")
                col = layout.column()

Modified: 
branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c   
    2009-08-21 03:09:27 UTC (rev 22669)
+++ 
branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c   
    2009-08-21 06:23:38 UTC (rev 22670)
@@ -4719,7 +4719,7 @@
                tablet= (wmtab->Active != EVT_TABLET_NONE);
                pressure= wmtab->Pressure;
                if(wmtab->Active == EVT_TABLET_ERASER)
-                       pop->s.blend= BRUSH_BLEND_ERASE_ALPHA;
+                       pop->s.blend= IMB_BLEND_ERASE_ALPHA;
        }
        else
                pressure= 1.0f;

Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_brush_types.h       
2009-08-21 03:09:27 UTC (rev 22669)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_brush_types.h       
2009-08-21 06:23:38 UTC (rev 22670)
@@ -86,16 +86,6 @@
 #define BRUSH_SMOOTH_STROKE    2048
 #define BRUSH_PERSISTENT       4096
 
-/* Brush.blend */
-#define BRUSH_BLEND_MIX                0
-#define BRUSH_BLEND_ADD                1
-#define BRUSH_BLEND_SUB                2
-#define BRUSH_BLEND_MUL                3
-#define BRUSH_BLEND_LIGHTEN            4
-#define BRUSH_BLEND_DARKEN             5
-#define BRUSH_BLEND_ERASE_ALPHA        6
-#define BRUSH_BLEND_ADD_ALPHA  7
-
 /* Brush.sculpt_tool */
 #define SCULPT_TOOL_DRAW    1
 #define SCULPT_TOOL_SMOOTH  2

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c      
2009-08-21 03:09:27 UTC (rev 22669)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c      
2009-08-21 06:23:38 UTC (rev 22670)
@@ -32,6 +32,8 @@
 #include "DNA_brush_types.h"
 #include "DNA_texture_types.h"
 
+#include "IMB_imbuf.h"
+
 EnumPropertyItem brush_sculpt_tool_items[] = {
        {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
        {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""},
@@ -93,14 +95,14 @@
        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."},
-               {BRUSH_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending 
mode while painting."},
-               {BRUSH_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending 
mode while painting."},
-               {BRUSH_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten 
blending mode while painting."},
-               {BRUSH_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken 
blending mode while painting."},
-               {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."},
+               {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while 
painting."},
+               {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while 
painting."},
+               {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending 
mode while painting."},
+               {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending 
mode while painting."},
+               {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten 
blending mode while painting."},
+               {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken blending 
mode while painting."},
+               {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}};
                
        srna= RNA_def_struct(brna, "Brush", "ID");


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to