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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-01-13 01:48:08 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-01-13 01:48:08 +0400
commitb2ae44dc41f7cf09bf20081734bf098d0f7cdb78 (patch)
treea201d5b2345374a4aa50a69dc3c4f4c98c522d2f /release/scripts
parent1b8eab0fab7b6c4755e10366c43f7f1a7097f661 (diff)
Fix some RNA/scene issuess with unified paint settings.
Added RNA for the unified paint setting flags that matches the Brush RNA. Fixed the getter/setter functions to avoid guessing which Scene's UnifiedPaintSetting to use. The getter functions take a Scene pointer now, the setter functions are removed in favor of a more explicit approach through RNA: Rather than RNA choosing whether a property's value is in the Brush or in the UnifiedPaintSettings, there are now explicit properties for both. The UI code has been modified accordingly to switch the toggle buttons between affecting the Brush and the UnifiedPaintSettings.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py37
1 files changed, 25 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index e89e2d9f484..a8ffb255b39 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -475,6 +475,17 @@ class PaintPanel():
parent.prop(ups, "use_unified_size", text="Size")
parent.prop(ups, "use_unified_strength", text="Strength")
+ @staticmethod
+ def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text=""):
+ ups = context.tool_settings.unified_paint_settings
+ ptr = ups if ups.use_unified_size else brush
+ parent.prop(ptr, prop_name, icon=icon, text=text)
+
+ @staticmethod
+ def prop_unified_strength(parent, context, brush, prop_name, icon='NONE', text=""):
+ ups = context.tool_settings.unified_paint_settings
+ ptr = ups if ups.use_unified_strength else brush
+ parent.prop(ptr, prop_name, icon=icon, text=text)
class VIEW3D_PT_tools_brush(PaintPanel, Panel):
bl_label = "Brush"
@@ -530,14 +541,16 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
- if brush.use_locked_size:
- row.prop(brush, "use_locked_size", toggle=True, text="", icon='LOCKED')
+ ups = context.tool_settings.unified_paint_settings
+ if ((ups.use_unified_size and ups.use_locked_size) or
+ ((not ups.use_unified_size) and brush.use_locked_size)):
+ self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
row.prop(brush, "unprojected_radius", text="Radius", slider=True)
else:
- row.prop(brush, "use_locked_size", toggle=True, text="", icon='UNLOCKED')
+ self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
row.prop(brush, "size", slider=True)
- row.prop(brush, "use_pressure_size", toggle=True, text="")
+ self.prop_unified_size(row, context, brush, "use_pressure_size")
if tool not in {'SNAKE_HOOK', 'GRAB', 'ROTATE'}:
col.separator()
@@ -551,12 +564,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "use_space_atten", toggle=True, text="", icon='UNLOCKED')
row.prop(brush, "strength", text="Strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
+ self.prop_unified_strength(row, context, brush, "use_pressure_strength")
if tool == 'ROTATE':
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
+ self.prop_unified_strength(row, context, brush, "use_pressure_strength")
if tool != 'SMOOTH':
col.separator()
@@ -644,11 +657,11 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
row.prop(brush, "size", slider=True)
- row.prop(brush, "use_pressure_size", toggle=True, text="")
+ self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
- row.prop(brush, "use_pressure_strength", toggle=True, text="")
+ self.prop_unified_strength(row, context, brush, "use_pressure_strength")
row = col.row(align=True)
row.prop(brush, "jitter", slider=True)
@@ -670,11 +683,11 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
row.prop(brush, "size", slider=True)
- row.prop(brush, "use_pressure_size", toggle=True, text="")
+ self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
- row.prop(brush, "use_pressure_strength", toggle=True, text="")
+ self.prop_unified_strength(row, context, brush, "use_pressure_strength")
row = col.row(align=True)
row.prop(brush, "jitter", slider=True)
@@ -688,11 +701,11 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
row.prop(brush, "size", slider=True)
- row.prop(brush, "use_pressure_size", toggle=True, text="")
+ self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
- row.prop(brush, "use_pressure_strength", toggle=True, text="")
+ self.prop_unified_strength(row, context, brush, "use_pressure_strength")
# XXX - TODO
#row = col.row(align=True)