Bugfix for Python errors in 3D View texture paint toolbar.

The stencil- and clone-layer menus were printing errors when the mesh
had no UV layers due to directly accessing layer names. Fixed by
setting menu text to empty if no UV layers exist.

Also changed the checkbox label for cloning from another UV layer to
read 'Clone' rather than 'Layer'.
This commit is contained in:
Nicholas Bishop
2012-02-28 02:08:32 +00:00
parent 2a4cd1d203
commit b2a4fca761

View File

@@ -1133,13 +1133,15 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
row = split.row()
row.active = (ipaint.use_stencil_layer)
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name)
stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text)
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
row = layout.row()
row.active = (settings.brush.image_tool == 'CLONE')
row.prop(ipaint, "use_clone_layer", text="Layer")
row.menu("VIEW3D_MT_tools_projectpaint_clone", text=mesh.uv_texture_clone.name)
row.prop(ipaint, "use_clone_layer", text="Clone")
clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else ""
row.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text)
layout.prop(ipaint, "seam_bleed")