[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55676] trunk/blender: Tidy up stroke options and make them sexy, aka the paint option

Antony Riakiotakis kalast at gmail.com
Sat Mar 30 12:40:10 CET 2013


Revision: 55676
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55676
Author:   psy-fi
Date:     2013-03-30 11:40:09 +0000 (Sat, 30 Mar 2013)
Log Message:
-----------
Tidy up stroke options and make them sexy, aka the paint option
sculptification commit. We have a drop menu to select the stroke mode
now. Jitter controls appear under stroke panel under all modes (As they
should! They stroke control options). Also enable jittering for all
modes. I really fail to see why not.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
    trunk/blender/source/blender/makesrna/intern/rna_brush.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2013-03-30 11:05:57 UTC (rev 55675)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2013-03-30 11:40:09 UTC (rev 55676)
@@ -697,13 +697,6 @@
             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
 
             row = col.row(align=True)
-            if(brush.use_relative_jitter):
-                row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
-                row.prop(brush, "jitter", slider=True)
-            else:
-                row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
-                row.prop(brush, "jitter_absolute")
-            row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
             col.prop(brush, "blend", text="Blend")
 
@@ -728,7 +721,20 @@
 
         brush_texture_settings(col, brush, 0)
 
+        # use_texture_overlay and texture_overlay_alpha
+        col = layout.column(align=True)
+        col.active = brush.brush_capabilities.has_overlay
+        col.label(text="Overlay:")
 
+        row = col.row()
+        if brush.use_texture_overlay:
+            row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+        else:
+            row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
+        sub = row.row()
+        sub.prop(brush, "texture_overlay_alpha", text="Alpha")
+
+
 class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel):
     bl_label = "Texture Mask"
     bl_options = {'DEFAULT_CLOSED'}
@@ -782,28 +788,48 @@
         col = layout.column()
         col.prop(toolsettings, "input_samples")
 
-        col.prop(brush, "use_airbrush")
-        row = col.row()
-        row.active = brush.use_airbrush
-        row.prop(brush, "rate", slider=True)
+        col = layout.column()
 
+        col.label(text="Stroke Method:")
+        
+        col.prop(brush, "stroke_method", text="")
+
+        if brush.use_anchor:
+            col.separator()
+            col.prop(brush, "use_edge_to_edge", "Edge To Edge")
+
+        if brush.use_airbrush:
+            col.separator()
+            col.prop(brush, "rate", text="Rate", slider=True)
+
+        if brush.use_space:
+            col.separator()
+            row = col.row(align=True)
+            row.active = brush.use_space
+            row.prop(brush, "spacing", text="Spacing")
+            row.prop(brush, "use_pressure_spacing", toggle=True, text="")
+
+
+        col = layout.column()
         col.separator()
 
         col.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)
+        sub = col.column()
+        sub.active = brush.use_smooth_stroke
+        sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+        sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
 
         col.separator()
 
-        col = layout.column()
-        col.prop(brush, "use_space")
         row = col.row(align=True)
-        row.active = brush.use_space
-        row.prop(brush, "spacing", text="Distance", slider=True)
-        row.prop(brush, "use_pressure_spacing", toggle=True, text="")
+        if brush.use_relative_jitter:
+            row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
+            row.prop(brush, "jitter", slider=True)
+        else:
+            row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
+            row.prop(brush, "jitter_absolute")
+        row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
         col.prop(brush, "use_wrap")
 

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-03-30 11:05:57 UTC (rev 55675)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-03-30 11:40:09 UTC (rev 55676)
@@ -681,13 +681,6 @@
             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
 
             row = col.row(align=True)
-            if(brush.use_relative_jitter):
-                row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
-                row.prop(brush, "jitter", slider=True)
-            else:
-                row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
-                row.prop(brush, "jitter_absolute")
-            row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
             col.prop(brush, "blend", text="Blend")
 
@@ -714,14 +707,7 @@
             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
 
             row = col.row(align=True)
-            if(brush.use_relative_jitter):
-                row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
-                row.prop(brush, "jitter", slider=True)
-            else:
-                row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
-                row.prop(brush, "jitter_absolute")
-            row.prop(brush, "use_pressure_jitter", toggle=True, text="")
-
+ 
             col.prop(brush, "vertex_tool", text="Blend")
 
         # Vertex Paint Mode #
@@ -830,29 +816,32 @@
 
         settings = self.paint_settings(context)
         brush = settings.brush
-        image_paint = context.image_paint_object
 
         col = layout.column()
 
+        col.label(text="Stroke Method:")
+        
         if context.sculpt_object:
-            col.label(text="Stroke Method:")
+            col.prop(brush, "sculpt_stroke_method", text="")
+        else:
             col.prop(brush, "stroke_method", text="")
 
-            if brush.use_anchor:
-                col.separator()
-                col.prop(brush, "use_edge_to_edge", "Edge To Edge")
+        if brush.use_anchor:
+            col.separator()
+            col.prop(brush, "use_edge_to_edge", "Edge To Edge")
 
-            if brush.use_airbrush:
-                col.separator()
-                col.prop(brush, "rate", text="Rate", slider=True)
+        if brush.use_airbrush:
+            col.separator()
+            col.prop(brush, "rate", text="Rate", slider=True)
 
-            if brush.use_space:
-                col.separator()
-                row = col.row(align=True)
-                row.active = brush.use_space
-                row.prop(brush, "spacing", text="Spacing")
-                row.prop(brush, "use_pressure_spacing", toggle=True, text="")
+        if brush.use_space:
+            col.separator()
+            row = col.row(align=True)
+            row.active = brush.use_space
+            row.prop(brush, "spacing", text="Spacing")
+            row.prop(brush, "use_pressure_spacing", toggle=True, text="")
 
+        if context.sculpt_object:
             if brush.sculpt_capabilities.has_smooth_stroke:
                 col = layout.column()
                 col.separator()
@@ -868,40 +857,34 @@
                 col.separator()
 
                 row = col.row(align=True)
-                if(brush.use_relative_jitter):
+                if brush.use_relative_jitter:
                     row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
                     row.prop(brush, "jitter", slider=True)
                 else:
                     row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
                     row.prop(brush, "jitter_absolute")
                 row.prop(brush, "use_pressure_jitter", toggle=True, text="")
-
         else:
-            col.prop(brush, "use_airbrush")
-
-            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 = layout.column()
             col.separator()
 
             col.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)
+            sub = col.column()
+            sub.active = brush.use_smooth_stroke
+            sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+            sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
 
             col.separator()
 
-            col = layout.column()
-            col.active = brush.brush_capabilities.has_spacing
-            col.prop(brush, "use_space")
-
             row = col.row(align=True)
-            row.active = brush.use_space
-            row.prop(brush, "spacing", text="Spacing")
-            row.prop(brush, "use_pressure_spacing", toggle=True, text="")
+            if brush.use_relative_jitter:
+                row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
+                row.prop(brush, "jitter", slider=True)
+            else:
+                row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
+                row.prop(brush, "jitter_absolute")
+            row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
 
 class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-03-30 11:05:57 UTC (rev 55675)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-03-30 11:40:09 UTC (rev 55676)
@@ -278,9 +278,7 @@
 
 	paint_brush_update(C, brush, mode, stroke, mouse_in, pressure);
 
-	/* TODO: as sculpt and other paint modes are unified, this
-	 * separation will go away */
-	if (paint_supports_jitter(mode)) {
+	{
 		float delta[2];
 		float factor = stroke->zoom_2d;
 
@@ -298,9 +296,6 @@
 			add_v2_v2v2(mouse_out, mouse_in, delta);
 		}
 	}
-	else {
-		copy_v2_v2(mouse_out, mouse_in);
-	}
 
 	/* TODO: can remove the if statement once all modes have this */
 	if (stroke->get_location)
@@ -525,11 +520,6 @@
 	return true;
 }
 
-bool paint_supports_jitter(PaintMode mode)
-{

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list