Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2013-03-11 05:46:22 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-03-11 05:46:22 +0400
commit722ada58fcf5c886941234c7dae1bb0cb9624af9 (patch)
treee31e637002aeebc62658bb7b6890e9dd5bc78b8c
parent38feedcaacd2bd317ea68a57014cddb2f9ceaf15 (diff)
Jitter: Change UI. Now use lock icon to indicate relative jitter, tied
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!
-rw-r--r--release/scripts/startup/bl_ui/space_image.py10
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py30
-rw-r--r--source/blender/makesrna/intern/rna_brush.c9
3 files changed, 25 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 6a8054dd5d6..c5486dd72d8 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -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")
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 24a216fe020..3bd2f642e0b 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -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")
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 85cc706dfa1..8950b78900f 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -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");