Home Website Youtube GitHub

Anim Picker changing button color

Hello everyone :slightly_smiling_face:

I’m using the picker a lot recently, and I am able to change a button’s color in it’s own custom script using the command:
__SELF __.set_color(color=[64, 44, 59, 255])

However, I was wondering if there is a way to change a bunch of other button’s colors “externally”? (meaning through another button)
My idea would be that with a simple click, I could adjust a group of button’s colors dynamically

thanks for your help!

1 Like

did a bit of messing with this also, couldnt see i direct way to do this but i got something working by taging items in init and then looking for them on the toggle button. not sure how well this will work on a big scene with lots of items. also drag selecting doesnt seem to trigger this so would probably be best used in right click menu.

here is what i did

this is custom action for the toggle item

if __INIT__:
    __SELF__.groupA = True
else:
    for item in __SELF__.scene().items():
        if item.__class__.__name__ == 'PickerItem':
            if hasattr(item, 'groupA'):
                if item.groupA:
                    item.set_color([255, 0, 0, 180])
                    item.groupA = False
                else:
                    item.set_color([200, 200, 200, 180])
                    item.groupA = True

this is custom action for other items that you want to be toggled

if __INIT__:
    __SELF__.groupA = True
3 Likes

This is genius! Thank you so much:)

1 Like