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:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-22 22:56:46 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-22 22:56:46 +0400
commit3b5b761a56424987790bd1aad6fcb9ac1f0a281b (patch)
treeb0b8c51df20dc3613ab265858c0ca072151e83ea /release
parent528cce431380d53176ce7a9f5835612e2536566a (diff)
== Sculpt/Paint Fixes ==
* Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/ui/space_view3d_toolbar.py89
1 files changed, 53 insertions, 36 deletions
diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py
index f902ba86a3f..589428dfe4d 100644
--- a/release/scripts/ui/space_view3d_toolbar.py
+++ b/release/scripts/ui/space_view3d_toolbar.py
@@ -555,7 +555,6 @@ class VIEW3D_PT_tools_brush(PaintPanel):
# Sculpt Mode #
elif context.sculpt_object and brush:
- edit = context.user_preferences.edit
col = layout.column()
@@ -564,21 +563,12 @@ class VIEW3D_PT_tools_brush(PaintPanel):
row = col.row(align=True)
- if edit.sculpt_paint_use_unified_size:
- if edit.sculpt_paint_unified_lock_brush_size:
- row.prop(edit, "sculpt_paint_unified_lock_brush_size", toggle=True, text="", icon='LOCKED')
- row.prop(edit, "sculpt_paint_unified_unprojected_radius", text="Radius", slider=True)
- else:
- row.prop(edit, "sculpt_paint_unified_lock_brush_size", toggle=True, text="", icon='UNLOCKED')
- row.prop(edit, "sculpt_paint_unified_size", text="Radius", slider=True)
-
+ if brush.use_locked_size:
+ row.prop(brush, "use_locked_size", toggle=True, text="", icon='LOCKED')
+ row.prop(brush, "unprojected_radius", text="Radius", slider=True)
else:
- if brush.lock_brush_size:
- row.prop(brush, "lock_brush_size", toggle=True, text="", icon='LOCKED')
- row.prop(brush, "unprojected_radius", text="Radius", slider=True)
- else:
- row.prop(brush, "lock_brush_size", toggle=True, text="", icon='UNLOCKED')
- row.prop(brush, "size", text="Radius", slider=True)
+ row.prop(brush, "use_locked_size", toggle=True, text="", icon='UNLOCKED')
+ row.prop(brush, "size", text="Radius", slider=True)
row.prop(brush, "use_size_pressure", toggle=True, text="")
@@ -594,11 +584,7 @@ class VIEW3D_PT_tools_brush(PaintPanel):
else:
row.prop(brush, "use_space_atten", toggle=True, text="", icon='UNLOCKED')
- if edit.sculpt_paint_use_unified_strength:
- row.prop(edit, "sculpt_paint_unified_strength", text="Unified Strength", slider=True)
- else:
- row.prop(brush, "strength", text="Strength", slider=True)
-
+ row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_strength_pressure", text="")
@@ -710,11 +696,11 @@ class VIEW3D_PT_tools_brush(PaintPanel):
col.prop(brush, "color", text="")
row = col.row(align=True)
- row.prop(brush, "size", slider=True)
+ row.prop(brush, "size", text="Radius", slider=True)
row.prop(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
- row.prop(brush, "strength", slider=True)
+ row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_strength_pressure", toggle=True, text="")
row = col.row(align=True)
@@ -735,12 +721,13 @@ class VIEW3D_PT_tools_brush(PaintPanel):
layout.prop(context.tool_settings, "auto_normalize", text="Auto Normalize")
col = layout.column()
+
row = col.row(align=True)
- row.prop(brush, "size", slider=True)
+ row.prop(brush, "size", text="Radius", slider=True)
row.prop(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
- row.prop(brush, "strength", slider=True)
+ row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_strength_pressure", toggle=True, text="")
row = col.row(align=True)
@@ -755,11 +742,11 @@ class VIEW3D_PT_tools_brush(PaintPanel):
col.prop(brush, "color", text="")
row = col.row(align=True)
- row.prop(brush, "size", slider=True)
+ row.prop(brush, "size", text="Radius", slider=True)
row.prop(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
- row.prop(brush, "strength", slider=True)
+ row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_strength_pressure", toggle=True, text="")
# XXX - TODO
@@ -1032,7 +1019,8 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
wide_ui = context.region.width > narrowui
- sculpt = context.tool_settings.sculpt
+ tool_settings = context.tool_settings
+ sculpt = tool_settings.sculpt
settings = self.paint_settings(context)
brush = settings.brush
@@ -1040,10 +1028,9 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
col = split.column()
- edit = context.user_preferences.edit
col.label(text="Unified Settings:")
- col.prop(edit, "sculpt_paint_use_unified_size", text="Size")
- col.prop(edit, "sculpt_paint_use_unified_strength", text="Strength")
+ col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
+ col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
if wide_ui:
col = split.column()
@@ -1108,17 +1095,19 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel):
settings = self.paint_settings(context)
brush = settings.brush
- if context.sculpt_object and context.tool_settings.sculpt:
- col = layout.column();
+ col = layout.column();
- #if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'CLAY_TUBES', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE'):
+ if context.sculpt_object and context.tool_settings.sculpt:
+ #if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE', 'CLAY_TUBES'):
if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE'):
col.prop(brush, "add_col", text="Add Color")
col.prop(brush, "sub_col", text="Subtract Color")
else:
col.prop(brush, "add_col", text="Color")
+ else:
+ col.prop(brush, "add_col", text="Color")
- col.separator()
+ col.separator()
col = layout.column()
col.label(text="Icon:")
@@ -1154,7 +1143,8 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
def draw(self, context):
layout = self.layout
- wpaint = context.tool_settings.weight_paint
+ tool_settings = context.tool_settings
+ wpaint = tool_settings.weight_paint
col = layout.column()
col.prop(wpaint, "all_faces")
@@ -1167,6 +1157,10 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
col.prop(mesh, "use_mirror_x")
col.prop(mesh, "use_mirror_topology")
+ col.label(text="Unified Settings:")
+ col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
+ col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
+
# Commented out because the Apply button isn't an operator yet, making these settings useless
# col.label(text="Gamma:")
# col.prop(wpaint, "gamma", text="")
@@ -1186,7 +1180,8 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
def draw(self, context):
layout = self.layout
- vpaint = context.tool_settings.vertex_paint
+ tool_settings = context.tool_settings
+ vpaint = tool_settings.vertex_paint
col = layout.column()
#col.prop(vpaint, "mode", text="")
@@ -1194,6 +1189,10 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
col.prop(vpaint, "normals")
col.prop(vpaint, "spray")
+ col.label(text="Unified Settings:")
+ col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
+ col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
+
# Commented out because the Apply button isn't an operator yet, making these settings useless
# col.label(text="Gamma:")
# col.prop(vpaint, "gamma", text="")
@@ -1272,6 +1271,23 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel):
sub.operator("image.save_dirty", text="Save All Edited")
+class VIEW3D_PT_imagepaint_options(PaintPanel):
+ bl_label = "Options"
+ bl_default_closed = True
+
+ def poll(self, context):
+ return (context.texture_paint_object and context.tool_settings.image_paint)
+
+ def draw(self, context):
+ layout = self.layout
+
+ col = layout.column()
+
+ tool_settings = context.tool_settings
+ col.label(text="Unified Settings:")
+ col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
+ col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
+
class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu):
bl_label = "Clone Layer"
@@ -1385,6 +1401,7 @@ classes = [
VIEW3D_PT_sculpt_options,
VIEW3D_PT_tools_vertexpaint,
VIEW3D_PT_tools_weightpaint_options,
+ VIEW3D_PT_imagepaint_options,
VIEW3D_PT_tools_projectpaint,
VIEW3D_MT_tools_projectpaint_clone,