From 1c789199d5e2ffbcd2fae9be1ac26410db21746e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 20 Feb 2024 18:09:04 +0100 Subject: [PATCH] Anim: Bone properties panel, add missing 'solo' property Solo'ing bone collections was only possible from the Armature properties panel. However, the bone collections shown on the Bone properties panel should have the same functionality. Pull Request: https://projects.blender.org/blender/blender/pulls/118512 --- scripts/startup/bl_ui/properties_data_bone.py | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/startup/bl_ui/properties_data_bone.py b/scripts/startup/bl_ui/properties_data_bone.py index e58a81d8c0b..b1c0d1e4ca8 100644 --- a/scripts/startup/bl_ui/properties_data_bone.py +++ b/scripts/startup/bl_ui/properties_data_bone.py @@ -260,6 +260,16 @@ class BONE_PT_collections(BoneButtonsPanel, Panel): layout.use_property_split = False bone = context.bone or context.edit_bone + object = context.pose_object or context.edit_object or context.object + if not object: + layout.active = False + sub = layout.column(align=True) + sub.label(text="Cannot figure out which object this bone belongs to.") + sub.label(text="Please file a bug report.") + return + + armature = object.data + is_solo_active = armature.collections.is_solo_active if not bone.collections: layout.active = False @@ -275,8 +285,15 @@ class BONE_PT_collections(BoneButtonsPanel, Panel): # Name & visibility of bcoll. Safe things, so aligned together. row = bcoll_row.row(align=True) row.label(text=bcoll.name) - row.prop(bcoll, "is_visible", text="", - icon='HIDE_OFF' if bcoll.is_visible else 'HIDE_ON') + + # Sub-layout that's dimmed when the bone collection's own visibility flag doesn't matter. + sub_visible = row.row(align=True) + sub_visible.active = (not is_solo_active) and bcoll.is_visible_ancestors + sub_visible.prop(bcoll, "is_visible", text="", + icon='HIDE_OFF' if bcoll.is_visible else 'HIDE_ON') + + row.prop(bcoll, "is_solo", text="", + icon='SOLO_ON' if bcoll.is_solo else 'SOLO_OFF') # Unassignment operator, less safe so with a bit of spacing. props = bcoll_row.operator("armature.collection_unassign_named",