Fix missing weight-paint overlay popover when mixing pose & weight-paint

Since [0] mixing weight-paint & pose modes made weight-paint overlay
options inaccessible. Display both popovers in the 3D view header
in this case.

[0]: 4fa4f5432d39b1d942d603436232a00a79db491d
This commit is contained in:
Campbell Barton 2023-09-15 10:44:46 +10:00
parent a106760efa
commit 2c28f87230

@ -964,14 +964,7 @@ class VIEW3D_HT_header(Header):
sub.active = overlay.show_overlays
sub.popover(panel="VIEW3D_PT_overlay", text="")
show_bone_overlays = (
has_pose_mode 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 mode_string == 'EDIT_MESH':
if mode_string == 'EDIT_MESH':
sub.popover(panel="VIEW3D_PT_overlay_edit_mesh", text="", icon='EDITMODE_HLT')
if mode_string == 'EDIT_CURVE':
sub.popover(panel="VIEW3D_PT_overlay_edit_curve", text="", icon='EDITMODE_HLT')
@ -988,6 +981,13 @@ class VIEW3D_HT_header(Header):
elif obj is not None and obj.type == 'GPENCIL':
sub.popover(panel="VIEW3D_PT_overlay_gpencil_options", text="", icon='OUTLINER_DATA_GREASEPENCIL')
# Separate from `elif` chain because it may coexist with weight-paint.
if (
has_pose_mode or
(object_mode in {'EDIT_ARMATURE', 'OBJECT'} and VIEW3D_PT_overlay_bones.is_using_wireframe(context))
):
sub.popover(panel="VIEW3D_PT_overlay_bones", text="", icon='POSE_HLT')
row = layout.row()
row.active = (object_mode == 'EDIT') or (shading.type in {'WIREFRAME', 'SOLID'})