From a8e9d5533f51455febc40d386c8c2ce0cc561b7a Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 15 May 2012 04:50:47 +0000 Subject: Code/UI cleanup: improvements for sculpt brush texture settings. Settings are shown in both the View3D toolbar and texture properties panel; code is now in shared sculpt_brush_texture_settings() function in properties_paint_common.py. Also added a few new properties to the SculptCapabilities RNA to replace "X in {Y, Z}" tests in the Python code. --- .../startup/bl_ui/properties_paint_common.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'release/scripts/startup/bl_ui/properties_paint_common.py') diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 94df1ed6cf5..53cf640beb9 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -67,3 +67,37 @@ class UnifiedPaintPanel(): ups = context.tool_settings.unified_paint_settings ptr = ups if ups.use_unified_weight else brush parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider) + + +# Used in both the View3D toolbar and texture properties +def sculpt_brush_texture_settings(layout, brush): + tex_slot = brush.texture_slot + + layout.label(text="Brush Mapping:") + + # map_mode + layout.row().prop(tex_slot, "map_mode", text="") + layout.separator() + + # angle and texture_angle_source + col = layout.column() + col.active = brush.sculpt_capabilities.has_texture_angle_source + col.label(text="Angle:") + if brush.sculpt_capabilities.has_random_texture_angle: + col.prop(brush, "texture_angle_source_random", text="") + else: + col.prop(brush, "texture_angle_source_no_random", text="") + + col = layout.column() + col.active = brush.sculpt_capabilities.has_texture_angle + col.prop(tex_slot, "angle", text="") + + # scale and offset + split = layout.split() + split.prop(tex_slot, "offset") + split.prop(tex_slot, "scale") + + # texture_sample_bias + col = layout.column(align=True) + col.label(text="Sample Bias:") + col.prop(brush, "texture_sample_bias", slider=True, text="") -- cgit v1.2.3