diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-07-21 14:02:05 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-07-21 14:02:05 +0400 |
commit | f745564e4ee791e4faf804b09ce975b882f4f8d9 (patch) | |
tree | 90ebbe363ccd925cedc652c9bb018ce552b5a2ab /release/scripts/startup/bl_ui/properties_paint_common.py | |
parent | 8489b94e07f9e73bd3c9c3e4f6a91f1f0a259827 (diff) |
GSOC 2013 paint
Yep, at last it's here!
There are a few minor issues remaining but development can go on in
master after discussion at blender institute.
For full list of features see:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting
Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_paint_common.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 462ca2e85ca..8359ae651ff 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -50,6 +50,10 @@ class UnifiedPaintPanel(): row.prop(ups, "use_unified_strength", text="Strength") if context.weight_paint_object: parent.prop(ups, "use_unified_weight", text="Weight") + elif context.vertex_paint_object or context.image_paint_object: + parent.prop(ups, "use_unified_color", text="Color") + else: + parent.prop(ups, "use_unified_color", text="Color") @staticmethod def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text="", slider=False): @@ -69,6 +73,105 @@ class UnifiedPaintPanel(): ptr = ups if ups.use_unified_weight else brush parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider) + @staticmethod + def prop_unified_color(parent, context, brush, prop_name, text=""): + ups = context.tool_settings.unified_paint_settings + ptr = ups if ups.use_unified_color else brush + parent.prop(ptr, prop_name, text=text) + + @staticmethod + def prop_unified_color_picker(parent, context, brush, prop_name, value_slider=True): + ups = context.tool_settings.unified_paint_settings + ptr = ups if ups.use_unified_color else brush + parent.template_color_picker(ptr, prop_name, value_slider=value_slider) + + +def brush_texpaint_common(panel, context, layout, brush, settings): + capabilities = brush.image_paint_capabilities + + col = layout.column() + + if brush.image_tool in {'DRAW', 'FILL'}: + if brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'}: + if not brush.use_gradient: + panel.prop_unified_color_picker(col, context, brush, "color", value_slider=True) + + if settings.palette: + col.template_palette(settings, "palette", color=True) + + if brush.use_gradient: + col.label("Gradient Colors") + col.template_color_ramp(brush, "gradient", expand=True) + + if brush.image_tool != 'FILL': + col.label("Background Color") + row = col.row(align=True) + panel.prop_unified_color(row, context, brush, "secondary_color", text="") + + if brush.image_tool == 'DRAW': + col.prop(brush, "gradient_stroke_mode", text="Mode") + if brush.gradient_stroke_mode in {'SPACING_REPEAT', 'SPACING_CLAMP'}: + col.prop(brush, "grad_spacing") + elif brush.image_tool == 'FILL': + col.prop(brush, "gradient_fill_mode") + else: + row = col.row(align=True) + panel.prop_unified_color(row, context, brush, "color", text="") + if brush.image_tool == 'FILL': + col.prop(brush, "fill_threshold") + else: + panel.prop_unified_color(row, context, brush, "secondary_color", text="") + row.separator() + row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="") + + elif brush.image_tool == 'SOFTEN': + col = layout.column(align=True) + col.row().prop(brush, "direction", expand=True) + col.separator() + col.prop(brush, "sharp_threshold") + col.prop(brush, "blur_kernel_radius") + col.separator() + col.prop(brush, "blur_mode") + elif brush.image_tool == 'MASK': + col.prop(brush, "weight", text="Mask Value", slider=True) + + elif brush.image_tool == 'CLONE': + col.separator() + col.prop(brush, "clone_image", text="Image") + col.prop(brush, "clone_alpha", text="Alpha") + + col.separator() + + if capabilities.has_radius: + row = col.row(align=True) + panel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") + panel.prop_unified_size(row, context, brush, "use_pressure_size") + + row = col.row(align=True) + + if capabilities.has_space_attenuation: + row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True) + + panel.prop_unified_strength(row, context, brush, "strength", text="Strength") + panel.prop_unified_strength(row, context, brush, "use_pressure_strength") + + if brush.image_tool in {'DRAW', 'FILL'}: + col.separator() + col.prop(brush, "blend", text="Blend") + + col = layout.column() + + # use_accumulate + if capabilities.has_accumulate: + col = layout.column(align=True) + col.prop(brush, "use_accumulate") + + col.prop(brush, "use_alpha") + col.prop(brush, "use_gradient") + + col.separator() + col.template_ID(settings, "palette", new="palette.new") + # Used in both the View3D toolbar and texture properties def brush_texture_settings(layout, brush, sculpt): @@ -136,6 +239,7 @@ def brush_mask_texture_settings(layout, brush): layout.operator("brush.stencil_reset_transform").mask = True col = layout.column() + col.prop(brush, "use_pressure_masking", text="") col.label(text="Angle:") col.active = brush.brush_capabilities.has_texture_angle col.prop(mask_tex_slot, "angle", text="") |