diff options
author | Sebastian Parborg <zeddb> | 2018-09-20 20:53:16 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-20 20:54:33 +0300 |
commit | d0eed5e50a80ef4df9ecb14772c87d4ede11e621 (patch) | |
tree | 2c59f9f4262f9309ca5e0130d6534ee71b543ad1 /release/scripts/startup/bl_ui/space_view3d_toolbar.py | |
parent | 09ea940e7ba8c4905e692134dfc14d0a6fbf909b (diff) |
Texture Paint: unify missing data and slots panels, better auto position nodes.
Differential Revision: https://developer.blender.org/D3694
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d_toolbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 97 |
1 files changed, 37 insertions, 60 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index c714af1a7b5..035f08507f9 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -207,64 +207,6 @@ class View3DPaintPanel(UnifiedPaintPanel): bl_region_type = 'WINDOW' -class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel): - bl_category = "Tools" - bl_context = ".imagepaint" # dot on purpose (access from topbar) - bl_label = "Missing Data" - - @classmethod - def poll(cls, context): - toolsettings = context.tool_settings.image_paint - return context.image_paint_object and not toolsettings.detect_data() - - def draw(self, context): - layout = self.layout - toolsettings = context.tool_settings.image_paint - - col = layout.column() - col.label(text="Missing Data", icon='ERROR') - if toolsettings.missing_uvs: - col.separator() - col.label(text="Missing UVs", icon='INFO') - col.label(text="Unwrap the mesh in edit mode or generate a simple UV layer") - col.operator("paint.add_simple_uvs") - - if toolsettings.mode == 'MATERIAL': - if toolsettings.missing_materials: - col.separator() - col.label(text="Missing Materials", icon='INFO') - col.label(text="Add a material and paint slot below") - col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") - elif toolsettings.missing_texture: - ob = context.active_object - mat = ob.active_material - - col.separator() - if mat: - col.label(text="Missing Texture Slots", icon='INFO') - col.label(text="Add a paint slot below") - col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") - else: - col.label(text="Missing Materials", icon='INFO') - col.label(text="Add a material and paint slot below") - col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") - - elif toolsettings.mode == 'IMAGE': - if toolsettings.missing_texture: - col.separator() - col.label(text="Missing Canvas", icon='INFO') - col.label(text="Add or assign a canvas image below") - col.label(text="Canvas Image:") - col.template_ID(toolsettings, "canvas", new="image.new", open="image.open") - - if toolsettings.missing_stencil: - col.separator() - col.label(text="Missing Stencil", icon='INFO') - col.label(text="Add or assign a stencil image below") - col.label(text="Stencil Image:") - col.template_ID(toolsettings, "stencil_image", new="image.new", open="image.open") - - # TODO, move to space_view3d.py class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): bl_context = ".paint_common" # dot on purpose (access from topbar) @@ -567,7 +509,6 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel): col.template_list("MATERIAL_UL_matslots", "layers", ob, "material_slots", ob, "active_material_index", rows=2) - mat = ob.active_material if mat: col.label(text="Available Paint Slots:") @@ -595,6 +536,43 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel): col.separator() col.operator("image.save_dirty", text="Save All Images") + ### Add Texture paint UVs/slots + if settings.missing_uvs: + col.separator() + col.label(text="No UVs available", icon='INFO') + col.operator("paint.add_simple_uvs") + + if settings.mode == 'MATERIAL': + if settings.missing_materials: + col.separator() + col.label(text="Add a material and paint slot below") + col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") + else: + ob = context.active_object + mat = ob.active_material + + col.separator() + if mat: + col.label(text="Add a paint slot below") + col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") + else: + col.label(text="Add a material and paint slot below") + col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") + + elif settings.mode == 'IMAGE': + if settings.missing_texture: + col.separator() + col.label(text="Missing Canvas", icon='INFO') + col.label(text="Add or assign a canvas image below") + col.label(text="Canvas Image:") + col.template_ID(settings, "canvas", new="image.new", open="image.open") + + if settings.missing_stencil: + col.separator() + col.label(text="Missing Stencil", icon='INFO') + col.label(text="Add or assign a stencil image below") + col.label(text="Stencil Image:") + col.template_ID(settings, "stencil_image", new="image.new", open="image.open") # TODO, move to space_view3d.py class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel): @@ -1781,7 +1759,6 @@ classes = ( VIEW3D_PT_tools_curveedit_options_stroke, VIEW3D_PT_tools_armatureedit_options, VIEW3D_PT_tools_posemode_options, - VIEW3D_PT_imapaint_tools_missing, VIEW3D_PT_tools_brush, TEXTURE_UL_texpaintslots, VIEW3D_MT_tools_projectpaint_uvlayer, |