Jitter: Change UI. Now use lock icon to indicate relative jitter, tied
authorAntony Riakiotakis <kalast@gmail.com>
Mon, 11 Mar 2013 01:46:22 +0000 (01:46 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Mon, 11 Mar 2013 01:46:22 +0000 (01:46 +0000)
to brush size, and unlock icon to indicate absolute jitter untied to
brush size, in screen pixels. Also relative jitter now has soft UI limit
of 2.0 and a hard limit of 1000 times the size of the brush. Should be
enough for the most vivid imaginations...I hope!

release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/makesrna/intern/rna_brush.c

index 6a8054d..c5486dd 100644 (file)
@@ -698,13 +698,13 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel):
             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
 
             row = col.row(align=True)
-            if(brush.use_absolute_jitter):
-                row.prop(brush, "jitter_absolute", slider=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, "jitter", slider=True)
+               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_absolute_jitter")
 
             col.prop(brush, "blend", text="Blend")
 
index 24a216f..3bd2f64 100644 (file)
@@ -678,14 +678,14 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
 
             row = col.row(align=True)
-            if(brush.use_absolute_jitter):
-                row.prop(brush, "jitter_absolute")
-            else:
+            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_absolute_jitter")
-
             col.prop(brush, "blend", text="Blend")
 
             col = layout.column()
@@ -711,13 +711,13 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
 
             row = col.row(align=True)
-            if(brush.use_absolute_jitter):
-                row.prop(brush, "jitter_absolute")
+            if(brush.use_relative_jitter):
+               row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
+               row.prop(brush, "jitter", slider=True)
             else:
-                row.prop(brush, "jitter", slider=True)
+               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_absolute_jitter")
 
             col.prop(brush, "vertex_tool", text="Blend")
 
@@ -838,13 +838,13 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
                 col.separator()
 
                 row = col.row(align=True)
-                if(brush.use_absolute_jitter):
-                    row.prop(brush, "jitter_absolute")
-                else:
+                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_absolute_jitter")
 
         else:
             col.prop(brush, "use_airbrush")
index 85cc706..8950b78 100644 (file)
@@ -633,14 +633,15 @@ static void rna_def_brush(BlenderRNA *brna)
 
        prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "jitter");
-       RNA_def_property_range(prop, 0.0f, 1.0f);
+       RNA_def_property_range(prop, 0.0f, 1000.0f);
+       RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.1, 4);
        RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
        RNA_def_property_update(prop, 0, "rna_Brush_update");
 
        prop = RNA_def_property(srna, "jitter_absolute", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "jitter_absolute");
        RNA_def_property_range(prop, 0, 1000000);
-       RNA_def_property_ui_text(prop, "Absolute Jitter", "Jitter the position of the brush while painting in pixels");
+       RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush in pixels while painting");
        RNA_def_property_update(prop, 0, "rna_Brush_update");
 
        prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
@@ -799,8 +800,8 @@ static void rna_def_brush(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction");
        RNA_def_property_update(prop, 0, "rna_Brush_update");
 
-       prop = RNA_def_property(srna, "use_absolute_jitter", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ABSOLUTE_JITTER);
+       prop = RNA_def_property(srna, "use_relative_jitter", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_ABSOLUTE_JITTER);
        RNA_def_property_ui_text(prop, "Absolute Jitter", "Jittering happens in screen space, not relative to brush size");
        RNA_def_property_update(prop, 0, "rna_Brush_update");