Reply To: UI script & armature properties tab “solo” bone collections…

Forum Archive UI script & armature properties tab “solo” bone collections… Reply To: UI script & armature properties tab “solo” bone collections…

#91374
Dwayne Savage
Participant

    I don’t know about layout, but to add the functionality you just have to change is_visible to is_solo.

    row.prop(context.active_object.data.collections["Root"], "is_visible",toggle=True, text="Root")
    row.prop(context.active_object.data.collections["Root"], "is_solo",toggle=True, text="Root Solo")

    Of course if you wanted to use the icon you could do something like this:

    row.prop(context.active_object.data.collections["Root"], "is_visible",toggle=True, text="Root")
    if context.active_object.data.collections["Root"].is_solo:
         row.prop(context.active_object.data.collections["Root"], "is_solo",toggle=True, text="", icon="SOLO_ON")
    else:
         row.prop(context.active_object.data.collections["Root"], "is_solo",toggle=True, text="", icon="SOLO_OFF")