diff options
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 104 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 130 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 145 |
4 files changed, 293 insertions, 88 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="") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 97c89df0693..b3ba3b6305f 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -22,6 +22,7 @@ from bpy.types import Header, Menu, Panel from bl_ui.properties_paint_common import ( UnifiedPaintPanel, brush_texture_settings, + brush_texpaint_common, brush_mask_texture_settings, ) from bl_ui.properties_grease_pencil_common import GreasePencilPanel @@ -31,13 +32,11 @@ from bpy.app.translations import pgettext_iface as iface_ class ImagePaintPanel(UnifiedPaintPanel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' - bl_category = "Tools" -class BrushButtonsPanel: +class BrushButtonsPanel(UnifiedPaintPanel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' - bl_category = "Tools" @classmethod def poll(cls, context): @@ -66,6 +65,7 @@ class IMAGE_MT_view(Menu): sima = context.space_data uv = sima.uv_editor toolsettings = context.tool_settings + paint = toolsettings.image_paint show_uvedit = sima.show_uvedit show_render = sima.show_render @@ -80,6 +80,8 @@ class IMAGE_MT_view(Menu): layout.prop(toolsettings, "show_uv_local_view") layout.prop(uv, "show_other_objects") + if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'): + layout.prop(uv, "show_texpaint") layout.separator() @@ -140,6 +142,24 @@ class IMAGE_MT_select(Menu): layout.operator("uv.select_split") +class IMAGE_MT_brush(Menu): + bl_label = "Brush" + + def draw(self, context): + layout = self.layout + toolsettings = context.tool_settings + settings = toolsettings.image_paint + brush = settings.brush + + ups = context.tool_settings.unified_paint_settings + layout.prop(ups, "use_unified_size", text="Unified Size") + layout.prop(ups, "use_unified_strength", text="Unified Strength") + layout.separator() + + # brush tool + layout.prop_menu_enum(brush, "image_tool") + + class IMAGE_MT_image(Menu): bl_label = "Image" @@ -382,7 +402,6 @@ class IMAGE_HT_header(Header): mode = sima.mode show_render = sima.show_render - # show_paint = sima.show_paint show_uvedit = sima.show_uvedit show_maskedit = sima.show_maskedit @@ -401,8 +420,7 @@ class IMAGE_HT_header(Header): row = layout.row() row.template_ID(sima, "mask", new="mask.new") - if show_uvedit or show_maskedit: - layout.prop(sima, "pivot_point", icon_only=True) + layout.prop(sima, "pivot_point", icon_only=True) # uv editing if show_uvedit: @@ -462,6 +480,7 @@ class MASK_MT_editor_menus(Menu): show_uvedit = sima.show_uvedit show_maskedit = sima.show_maskedit + show_paint = sima.show_paint layout.menu("IMAGE_MT_view") @@ -469,6 +488,8 @@ class MASK_MT_editor_menus(Menu): layout.menu("IMAGE_MT_select") if show_maskedit: layout.menu("MASK_MT_select") + if show_paint: + layout.menu("IMAGE_MT_brush") if ima and ima.is_dirty: layout.menu("IMAGE_MT_image", text="Image*") @@ -658,49 +679,27 @@ class IMAGE_PT_tools_transform_uvs(Panel, UVToolsPanel): col.operator("transform.shear") -class IMAGE_PT_paint(Panel, ImagePaintPanel): +class IMAGE_PT_paint(Panel, BrushButtonsPanel): bl_label = "Paint" - - @classmethod - def poll(cls, context): - sima = context.space_data - return sima.show_paint + bl_category = "Tools" def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + settings = context.tool_settings.image_paint + brush = settings.brush col = layout.column() - col.template_ID_preview(toolsettings, "brush", new="brush.add", rows=2, cols=6) + col.template_ID_preview(settings, "brush", new="brush.add", rows=2, cols=6) if brush: - col = layout.column() - - if brush.image_tool == 'DRAW' and brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'): - col.template_color_picker(brush, "color", value_slider=True) - col.prop(brush, "color", text="") - - row = col.row(align=True) - self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") - self.prop_unified_size(row, context, brush, "use_pressure_size") - - row = col.row(align=True) - self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength") - self.prop_unified_strength(row, context, brush, "use_pressure_strength") - - col.prop(brush, "blend", text="Blend") - - if brush.image_tool == 'CLONE': - col.separator() - col.prop(brush, "clone_image", text="Image") - col.prop(brush, "clone_alpha", text="Alpha") + brush_texpaint_common(self, context, layout, brush, settings) class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel): bl_label = "Overlay" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Options" def draw(self, context): layout = self.layout @@ -754,6 +753,7 @@ class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel): class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): bl_label = "Texture" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -770,6 +770,7 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): bl_label = "Texture Mask" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -786,6 +787,7 @@ class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): bl_label = "Tool" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Options" def draw(self, context): layout = self.layout @@ -804,6 +806,7 @@ class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): bl_label = "Paint Stroke" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -828,10 +831,19 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): if brush.use_space: col.separator() row = col.row(align=True) - row.active = brush.use_space row.prop(brush, "spacing", text="Spacing") row.prop(brush, "use_pressure_spacing", toggle=True, text="") + if brush.use_line or brush.use_curve: + col.separator() + row = col.row(align=True) + row.prop(brush, "spacing", text="Spacing") + + if brush.use_curve: + col.separator() + col.template_ID(brush, "paint_curve", new="paintcurve.new") + col.operator("paintcurve.draw") + col = layout.column() col.separator() @@ -846,25 +858,23 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): col = layout.column() col.separator() - col.prop(brush, "use_smooth_stroke") + if brush.brush_capabilities.has_smooth_stroke: + col.prop(brush, "use_smooth_stroke") - sub = col.column() - sub.active = brush.use_smooth_stroke - sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) - sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) + sub = col.column() + sub.active = brush.use_smooth_stroke + sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) + sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) - col.separator() + col.separator() col.prop(toolsettings, "input_samples") - col.separator() - - col.prop(brush, "use_wrap") - class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): bl_label = "Paint Curve" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -874,7 +884,8 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): layout.template_curve_mapping(brush, "curve") - row = layout.row(align=True) + col = layout.column(align=True) + row = col.row(align=True) row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH' row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND' row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' @@ -886,6 +897,7 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel): bl_label = "Appearance" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Options" def draw(self, context): layout = self.layout @@ -912,6 +924,30 @@ class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel): sub.prop(brush, "icon_filepath", text="") +class IMAGE_PT_tools_paint_options(BrushButtonsPanel, Panel): + bl_label = "Image Paint" + bl_category = "Options" + + def draw(self, context): + layout = self.layout + + toolsettings = context.tool_settings + brush = toolsettings.image_paint.brush + + ups = toolsettings.unified_paint_settings + + col = layout.column(align=True) + + col.prop(brush, "use_wrap") + col.separator() + + col.label(text="Unified Settings:") + row = col.row() + row.prop(ups, "use_unified_size", text="Size") + row.prop(ups, "use_unified_strength", text="Strength") + col.prop(ups, "use_unified_color", text="Color") + + class IMAGE_UV_sculpt_curve(Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 4cb3e8e116c..1079c5016a9 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1454,7 +1454,7 @@ class VIEW3D_MT_brush(Menu): layout.separator() if sculpt_tool != 'GRAB': - layout.prop_menu_enum(brush, "stroke_method") + layout.prop_menu_enum(brush, "sculpt_stroke_method") if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}: layout.prop_menu_enum(brush, "direction") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 0f2c04d1cdc..99b2b852936 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -18,11 +18,12 @@ # <pep8 compliant> import bpy -from bpy.types import Menu, Panel +from bpy.types import Menu, Panel, UIList from bl_ui.properties_grease_pencil_common import GreasePencilPanel from bl_ui.properties_paint_common import ( UnifiedPaintPanel, brush_texture_settings, + brush_texpaint_common, brush_mask_texture_settings, ) @@ -363,6 +364,7 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): draw_repeat_tools(context, layout) + class VIEW3D_PT_tools_meshweight(View3DPanel, Panel): bl_category = "Tools" bl_context = "mesh_edit" @@ -388,6 +390,7 @@ class VIEW3D_PT_tools_meshweight(View3DPanel, Panel): layout = self.layout self.draw_generic(layout) + class VIEW3D_PT_tools_add_mesh_edit(View3DPanel, Panel): bl_category = "Create" bl_context = "mesh_edit" @@ -979,25 +982,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): # Texture Paint Mode # elif context.image_paint_object and brush: - col = layout.column() - - if brush.image_tool == 'DRAW' and brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'): - col.template_color_picker(brush, "color", value_slider=True) - col.prop(brush, "color", text="") - - row = col.row(align=True) - self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") - self.prop_unified_size(row, context, brush, "use_pressure_size") - - row = col.row(align=True) - self.prop_unified_strength(row, context, brush, "strength", text="Strength") - self.prop_unified_strength(row, context, brush, "use_pressure_strength") - - col.prop(brush, "blend", text="Blend") - - col = layout.column() - col.active = (brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'}) - col.prop(brush, "use_alpha") + brush_texpaint_common(self, context, layout, brush, settings) # Weight Paint Mode # elif context.weight_paint_object and brush: @@ -1024,9 +1009,12 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): # Vertex Paint Mode # elif context.vertex_paint_object and brush: col = layout.column() - col.template_color_picker(brush, "color", value_slider=True) - col.prop(brush, "color", text="") + self.prop_unified_color_picker(col, context, brush, "color", value_slider=True) + if settings.palette: + col.template_palette(settings, "palette", color=True) + self.prop_unified_color(col, context, brush, "color", text="") + col.separator() row = col.row(align=True) self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") self.prop_unified_size(row, context, brush, "use_pressure_size") @@ -1036,12 +1024,75 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): self.prop_unified_strength(row, context, brush, "use_pressure_strength") # XXX - TODO - #row = col.row(align=True) - #row.prop(brush, "jitter", slider=True) - #row.prop(brush, "use_pressure_jitter", toggle=True, text="") - + # row = col.row(align=True) + # row.prop(brush, "jitter", slider=True) + # row.prop(brush, "use_pressure_jitter", toggle=True, text="") + col.separator() col.prop(brush, "vertex_tool", text="Blend") + col.separator() + col.template_ID(settings, "palette", new="palette.new") + + +class TEXTURE_UL_texpaintslots(UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): + ma = data + ima = item + + if self.layout_type in {'DEFAULT', 'COMPACT'}: + layout.label(text=ima.name, translate=False, icon_value=icon) + elif self.layout_type in {'GRID'}: + layout.alignment = 'CENTER' + layout.label(text="") + + +class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel): + bl_context = "imagepaint" + bl_label = "Slots" + bl_category = "Layers" + + @classmethod + def poll(cls, context): + brush = context.tool_settings.image_paint.brush + ob = context.active_object + return (brush is not None and ob is not None) + + def draw(self, context): + layout = self.layout + + settings = context.tool_settings.image_paint + brush = settings.brush + + ob = context.active_object + col = layout.column() + + if len(ob.material_slots) > 1: + col.label("Materials") + col.template_list("MATERIAL_UL_matslots", "", + ob, "material_slots", + ob, "active_material_index", rows=2) + + mat = ob.active_material + if mat: + col.label("Available Paint Slots") + col.template_list("TEXTURE_UL_texpaintslots", "", + mat, "texture_paint_slots", + mat, "paint_active_slot", rows=2) + + if not mat.use_nodes: + col.operator_menu_enum("paint.add_texture_paint_slot", "type") + + row = col.row(align=True) + row.prop(settings, "slot_xresolution_default") + row.prop(settings, "slot_yresolution_default") + col.prop(settings, "slot_color_default") + + if brush.image_tool == 'CLONE' and settings.use_clone_layer: + col.label("Clone Slot") + col.template_list("TEXTURE_UL_texpaintslots", "", + mat, "texture_paint_slots", + mat, "paint_clone_slot", rows=2) + class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel): bl_category = "Options" @@ -1194,10 +1245,19 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): if brush.use_space: col.separator() row = col.row(align=True) - row.active = brush.use_space row.prop(brush, "spacing", text="Spacing") row.prop(brush, "use_pressure_spacing", toggle=True, text="") + if brush.use_line or brush.use_curve: + col.separator() + row = col.row(align=True) + row.prop(brush, "spacing", text="Spacing") + + if brush.use_curve: + col.separator() + col.template_ID(brush, "paint_curve", new="paintcurve.new") + col.operator("paintcurve.draw") + if context.sculpt_object: if brush.sculpt_capabilities.has_jitter: col.separator() @@ -1234,12 +1294,13 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): col = layout.column() col.separator() - col.prop(brush, "use_smooth_stroke") + if brush.brush_capabilities.has_smooth_stroke: + col.prop(brush, "use_smooth_stroke") - sub = col.column() - sub.active = brush.use_smooth_stroke - sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) - sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) + sub = col.column() + sub.active = brush.use_smooth_stroke + sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) + sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) layout.prop(settings, "input_samples") @@ -1263,7 +1324,8 @@ class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel): layout.template_curve_mapping(brush, "curve", brush=True) - row = layout.row(align=True) + col = layout.column(align=True) + row = col.row(align=True) row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH' row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND' row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' @@ -1493,7 +1555,7 @@ class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel): col = layout.column() row = col.row() - #col.prop(vpaint, "mode", text="") + # col.prop(vpaint, "mode", text="") row.prop(vpaint, "use_normal") col.prop(vpaint, "use_spray") @@ -1531,7 +1593,7 @@ class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel): col.operator("image.save_dirty", text="Save All Edited") -class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): +class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel): bl_category = "Options" bl_context = "imagepaint" bl_label = "Project Paint" @@ -1551,6 +1613,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): settings = toolsettings.image_paint col = layout.column() + col.prop(ipaint, "use_occlude") col.prop(ipaint, "use_backface_culling") @@ -1565,19 +1628,21 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): split.prop(ipaint, "use_stencil_layer", text="Stencil") - row = split.row() - row.active = (ipaint.use_stencil_layer) + col = split.column() + col.active = (ipaint.use_stencil_layer) + row = col.row() stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else "" row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False) row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA') + col.template_ID(ipaint, "stencil_image", new="image.new") + col.prop(ipaint, "stencil_color") col = layout.column() col.active = (settings.brush.image_tool == 'CLONE') - col.prop(ipaint, "use_clone_layer", text="Clone from UV map") - clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else "" - col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False) + col.prop(ipaint, "use_clone_layer", text="Clone from paint slot") layout.prop(ipaint, "seam_bleed") + self.unified_paint_settings(layout, context) class VIEW3D_PT_imagepaint_options(View3DPaintPanel): |