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:
authorCampbell Barton <ideasman42@gmail.com>2011-10-12 04:47:50 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-12 04:47:50 +0400
commit50a851b946bc7eebdf3d489786f1a18c9ec3d8f1 (patch)
tree8476188a119059a3e41573c238e55d16e956b100 /release
parent18b9a2d0bcced11e6207ba98e1b92127c3705416 (diff)
python UI was doing a lot of attribute lookups on tool & sculpt tool (not especially efficient & annoying when adding breakpoints into why its not working right).
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py35
1 files changed, 19 insertions, 16 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index e322a6dcd13..8f1833f952b 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -484,16 +484,18 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
# XXX This needs a check if psys is editable.
if context.particle_edit_object:
+ tool = settings.tool
+
# XXX Select Particle System
layout.column().prop(settings, "tool", expand=True)
- if settings.tool != 'NONE':
+ if tool != 'NONE':
col = layout.column()
col.prop(brush, "size", slider=True)
- if settings.tool != 'ADD':
+ if tool != 'ADD':
col.prop(brush, "strength", slider=True)
- if settings.tool == 'ADD':
+ if tool == 'ADD':
col.prop(brush, "count")
col = layout.column()
col.prop(settings, "use_default_interpolate")
@@ -501,15 +503,16 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
sub.active = settings.use_default_interpolate
sub.prop(brush, "steps", slider=True)
sub.prop(settings, "default_key_count", slider=True)
- elif settings.tool == 'LENGTH':
+ elif tool == 'LENGTH':
layout.prop(brush, "length_mode", expand=True)
- elif settings.tool == 'PUFF':
+ elif tool == 'PUFF':
layout.prop(brush, "puff_mode", expand=True)
layout.prop(brush, "use_puff_volume")
# Sculpt Mode #
elif context.sculpt_object and brush:
+ tool = brush.sculpt_tool
col = layout.column()
@@ -526,12 +529,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "use_pressure_size", toggle=True, text="")
- if brush.sculpt_tool not in {'SNAKE_HOOK', 'GRAB', 'ROTATE'}:
+ if tool not in {'SNAKE_HOOK', 'GRAB', 'ROTATE'}:
col.separator()
row = col.row(align=True)
- if brush.use_space and brush.sculpt_tool not in {'SMOOTH'}:
+ if brush.use_space and tool != 'SMOOTH':
if brush.use_space_atten:
row.prop(brush, "use_space_atten", toggle=True, text="", icon='LOCKED')
else:
@@ -540,26 +543,26 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_pressure_strength", text="")
- if brush.sculpt_tool not in {'SMOOTH'}:
+ if tool != 'SMOOTH':
col.separator()
row = col.row(align=True)
row.prop(brush, "auto_smooth_factor", slider=True)
row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
- if brush.sculpt_tool in {'GRAB', 'SNAKE_HOOK'}:
+ if tool in {'GRAB', 'SNAKE_HOOK'}:
col.separator()
row = col.row(align=True)
row.prop(brush, "normal_weight", slider=True)
- if brush.sculpt_tool in {'CREASE', 'BLOB'}:
+ if tool in {'CREASE', 'BLOB'}:
col.separator()
row = col.row(align=True)
row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
- if brush.sculpt_tool not in {'PINCH', 'INFLATE', 'SMOOTH'}:
+ if tool not in {'PINCH', 'INFLATE', 'SMOOTH'}:
row = col.row(align=True)
col.separator()
@@ -571,8 +574,8 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "sculpt_plane", text="")
- #if brush.sculpt_tool in {'CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'}:
- if brush.sculpt_tool in {'CLAY', 'FLATTEN', 'FILL', 'SCRAPE'}:
+ #if tool in {'CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'}:
+ if tool in {'CLAY', 'FLATTEN', 'FILL', 'SCRAPE'}:
row = col.row(align=True)
row.prop(brush, "plane_offset", slider=True)
row.prop(brush, "use_offset_pressure", text="")
@@ -585,7 +588,7 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.active = brush.use_plane_trim
row.prop(brush, "plane_trim", slider=True, text="Distance")
- if brush.sculpt_tool == 'LAYER':
+ if tool == 'LAYER':
row = col.row()
row.prop(brush, "height", slider=True, text="Height")
@@ -597,12 +600,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
col.separator()
col.row().prop(brush, "direction", expand=True)
- if brush.sculpt_tool in {'DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY'}:
+ if tool in {'DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY'}:
col.separator()
col.prop(brush, "use_accumulate")
- if brush.sculpt_tool == 'LAYER':
+ if tool == 'LAYER':
col.separator()
ob = context.sculpt_object