Move stencil options to own panel under layer tab.

This commit is contained in:
Antony Riakiotakis 2014-07-24 12:41:39 +02:00
parent a93ec34ac8
commit 6a933c858c

@ -1088,6 +1088,48 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
col.prop_search(slot, "uv_layer", ob.data, "uv_textures", text="")
class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
bl_context = "imagepaint"
bl_label = "Stencil"
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_header(self, context):
ipaint = context.tool_settings.image_paint
self.layout.prop(ipaint, "use_stencil_layer", text="")
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
ipaint = toolsettings.image_paint
ob = context.active_object
mesh = ob.data
col = layout.column()
col.active = ipaint.use_stencil_layer
stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
col.label("UV Map")
col.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
col.label("Image")
row = col.row(align=True)
row.operator("image.new", icon='ZOOMIN', text="Add New").texstencil = True;
row.template_ID(ipaint, "stencil_image")
col.label("Visualization")
row = col.row(align=True)
row.prop(ipaint, "stencil_color", text="")
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
bl_category = "Options"
bl_label = "Overlay"
@ -1600,11 +1642,8 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
def draw(self, context):
layout = self.layout
ob = context.active_object
mesh = ob.data
toolsettings = context.tool_settings
ipaint = toolsettings.image_paint
# settings = toolsettings.image_paint
col = layout.column()
@ -1618,20 +1657,6 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
sub.active = (ipaint.use_normal_falloff)
sub.prop(ipaint, "normal_angle", text="")
split = layout.split()
split.prop(ipaint, "use_stencil_layer", text="Stencil")
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")
col.operator("image.new").texstencil = True;
col.prop(ipaint, "stencil_color")
layout.prop(ipaint, "seam_bleed")
self.unified_paint_settings(layout, context)