0

Dynamically update a menu's CheckState?

Hey all,

I have a custom package to load file LUTs and with a menu item can toggle their "lut.active" state. It works great when I have one source.

When I I have multiple sources loaded, and  a LUT per source, I can't get the menu to properly show the state of the current source, based on position in the timeline.  It shows the state of the last source that had the LUT changed, which I'm storing in a variable.

Is there a way to dynamically set a menu item based on a node property query? Using a stateHook that calls something like:

def LUTstate(self):

        if commands.getIntProperty("#RVLinearize.lut.active"):
            return commands.CheckedMenuState
        else:
            return commands.UncheckedMenuState

 

thanks,

Rick

1 条评论

  • 0
    Avatar
    Jon Morley

    Hi Rick,

    I am glad to hear you are having some success with your own LUT loader. That is terrific! I don't see anything that jumps out with the sample code you provided there perhaps it is something else. Could you share your entire package with us so we could dig in deeper and see what is going on in context, please?

    Thanks,
    Jon

请先登录再写评论。