UI: Viewport: Split object/mode overlays into its own popover #112156
@ -959,6 +959,32 @@ class VIEW3D_HT_header(Header):
|
||||
sub.active = overlay.show_overlays
|
||||
sub.popover(panel="VIEW3D_PT_overlay", text="")
|
||||
|
||||
show_bone_overlays = (
|
||||
(object_mode == 'POSE') or
|
||||
(object_mode == 'PAINT_WEIGHT' and context.pose_object) or
|
||||
(object_mode in {'EDIT_ARMATURE', 'OBJECT'} and
|
||||
VIEW3D_PT_overlay_bones.is_using_wireframe(context))
|
||||
)
|
||||
|
||||
if show_bone_overlays:
|
||||
sub.popover(panel="VIEW3D_PT_overlay_bones", text="", icon="POSE_HLT")
|
||||
elif context.mode == 'EDIT_MESH':
|
||||
sub.popover(panel="VIEW3D_PT_overlay_edit_mesh", text="", icon="EDITMODE_HLT")
|
||||
if context.mode == 'EDIT_CURVE':
|
||||
sub.popover(panel="VIEW3D_PT_overlay_edit_curve", text="", icon="EDITMODE_HLT")
|
||||
elif context.mode == 'SCULPT' and context.sculpt_object:
|
||||
sub.popover(panel="VIEW3D_PT_overlay_sculpt", text="", icon="SCULPTMODE_HLT")
|
||||
elif context.mode == 'SCULPT_CURVES' and context.object:
|
||||
sub.popover(panel="VIEW3D_PT_overlay_sculpt_curves", text="", icon="SCULPTMODE_HLT")
|
||||
elif context.mode == 'PAINT_WEIGHT':
|
||||
sub.popover(panel="VIEW3D_PT_overlay_weight_paint", text="", icon="WPAINT_HLT")
|
||||
elif context.mode == 'PAINT_TEXTURE':
|
||||
sub.popover(panel="VIEW3D_PT_overlay_texture_paint", text="", icon="TPAINT_HLT")
|
||||
elif context.mode == 'PAINT_VERTEX':
|
||||
sub.popover(panel="VIEW3D_PT_overlay_vertex_paint", text="", icon="VPAINT_HLT")
|
||||
elif context.object and context.object.type == 'GPENCIL':
|
||||
sub.popover(panel="VIEW3D_PT_overlay_gpencil_options", text="", icon="OUTLINER_DATA_GREASEPENCIL")
|
||||
|
||||
row = layout.row()
|
||||
row.active = (object_mode == 'EDIT') or (shading.type in {'WIREFRAME', 'SOLID'})
|
||||
|
||||
@ -6819,8 +6845,8 @@ class VIEW3D_PT_overlay_motion_tracking(Panel):
|
||||
class VIEW3D_PT_overlay_edit_mesh(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Mesh Edit Mode"
|
||||
bl_ui_units_x = 12
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -6828,6 +6854,7 @@ class VIEW3D_PT_overlay_edit_mesh(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.label(text="Mesh Edit Mode Overlays")
|
||||
|
||||
view = context.space_data
|
||||
shading = view.shading
|
||||
@ -7007,7 +7034,7 @@ class VIEW3D_PT_overlay_edit_mesh_normals(Panel):
|
||||
class VIEW3D_PT_overlay_edit_mesh_freestyle(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay_edit_mesh'
|
||||
bl_label = "Freestyle"
|
||||
|
||||
@classmethod
|
||||
@ -7032,7 +7059,6 @@ class VIEW3D_PT_overlay_edit_mesh_freestyle(Panel):
|
||||
class VIEW3D_PT_overlay_edit_curve(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Curve Edit Mode"
|
||||
|
||||
@classmethod
|
||||
@ -7045,6 +7071,8 @@ class VIEW3D_PT_overlay_edit_curve(Panel):
|
||||
overlay = view.overlay
|
||||
display_all = overlay.show_overlays
|
||||
|
||||
layout.label(text="Curve Edit Mode Overlays")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
|
||||
@ -7062,7 +7090,6 @@ class VIEW3D_PT_overlay_sculpt(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_context = ".sculpt_mode"
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Sculpt"
|
||||
|
||||
@classmethod
|
||||
@ -7078,6 +7105,8 @@ class VIEW3D_PT_overlay_sculpt(Panel):
|
||||
view = context.space_data
|
||||
overlay = view.overlay
|
||||
|
||||
layout.label(text="Sculpt Mode Overlays")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(overlay, "show_sculpt_mask", text="")
|
||||
sub = row.row()
|
||||
@ -7095,7 +7124,6 @@ class VIEW3D_PT_overlay_sculpt_curves(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_context = ".curves_sculpt"
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Sculpt"
|
||||
|
||||
@classmethod
|
||||
@ -7108,6 +7136,8 @@ class VIEW3D_PT_overlay_sculpt_curves(Panel):
|
||||
view = context.space_data
|
||||
overlay = view.overlay
|
||||
|
||||
layout.label(text="Curve Sculpt Overlays")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.active = overlay.show_overlays
|
||||
row.prop(overlay, "sculpt_mode_mask_opacity", text="Selection Opacity")
|
||||
@ -7123,7 +7153,6 @@ class VIEW3D_PT_overlay_sculpt_curves(Panel):
|
||||
class VIEW3D_PT_overlay_bones(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Bones"
|
||||
|
||||
@staticmethod
|
||||
@ -7161,6 +7190,8 @@ class VIEW3D_PT_overlay_bones(Panel):
|
||||
overlay = view.overlay
|
||||
display_all = overlay.show_overlays
|
||||
|
||||
layout.label(text="Armature Overlays")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
|
||||
@ -7181,7 +7212,6 @@ class VIEW3D_PT_overlay_bones(Panel):
|
||||
class VIEW3D_PT_overlay_texture_paint(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Texture Paint"
|
||||
|
||||
@classmethod
|
||||
@ -7194,6 +7224,8 @@ class VIEW3D_PT_overlay_texture_paint(Panel):
|
||||
overlay = view.overlay
|
||||
display_all = overlay.show_overlays
|
||||
|
||||
layout.label(text="Texture Paint Overlays")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
col.prop(overlay, "texture_paint_mode_opacity")
|
||||
@ -7202,7 +7234,6 @@ class VIEW3D_PT_overlay_texture_paint(Panel):
|
||||
class VIEW3D_PT_overlay_vertex_paint(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Vertex Paint"
|
||||
|
||||
@classmethod
|
||||
@ -7215,6 +7246,8 @@ class VIEW3D_PT_overlay_vertex_paint(Panel):
|
||||
overlay = view.overlay
|
||||
display_all = overlay.show_overlays
|
||||
|
||||
layout.label(text="Vertex Paint Overlays")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
|
||||
@ -7225,8 +7258,8 @@ class VIEW3D_PT_overlay_vertex_paint(Panel):
|
||||
class VIEW3D_PT_overlay_weight_paint(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = "Weight Paint"
|
||||
bl_ui_units_x = 12
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -7239,6 +7272,8 @@ class VIEW3D_PT_overlay_weight_paint(Panel):
|
||||
display_all = overlay.show_overlays
|
||||
tool_settings = context.tool_settings
|
||||
|
||||
layout.label(text="Weight Paint Overlays")
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
|
||||
@ -7467,15 +7502,18 @@ class VIEW3D_PT_gpencil_guide(Panel):
|
||||
class VIEW3D_PT_overlay_gpencil_options(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_parent_id = 'VIEW3D_PT_overlay'
|
||||
bl_label = ""
|
||||
bl_ui_units_x = 13
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.object and context.object.type == 'GPENCIL'
|
||||
|
||||
def draw_header(self, context):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
view = context.space_data
|
||||
overlay = view.overlay
|
||||
|
||||
layout.label(text={
|
||||
'PAINT_GPENCIL': iface_("Draw Grease Pencil"),
|
||||
'EDIT_GPENCIL': iface_("Edit Grease Pencil"),
|
||||
@ -7485,11 +7523,6 @@ class VIEW3D_PT_overlay_gpencil_options(Panel):
|
||||
'OBJECT': iface_("Grease Pencil"),
|
||||
}[context.mode], translate=False)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
view = context.space_data
|
||||
overlay = view.overlay
|
||||
|
||||
layout.prop(overlay, "use_gpencil_onion_skin", text="Onion Skin")
|
||||
|
||||
col = layout.column()
|
||||
|
Loading…
Reference in New Issue
Block a user