0

Manipulating menu created by another mode.

I have modified the CustomLUTMenuMode so it has LUTs for the current project context.  It works great and I love it.

 

I want source_setup.py to perform a menu selection in the CustomLUTMenu as if the user had done so.

 

I tried calling commands.mainWindowWidget to get the window object, but it choked, reporting:  "ERROR: 'module' object has no attribute 'mainWindowWidget'"
I tried making a global object in my customLUT mode and manipulating that global in source_setup.py, but globals defined in different modes don't seem to be in each other's scope.

 

Is there a way of doing this?  Am I barking up the wrong tree?

 

Thanks,

 -derick

3 comments

  • 0
    Avatar
    Jon Morley

    Hi Derick,

    If you really want to trigger menu calls from source_setup (something I don't recommend since it will likely trigger other events and graph state changes), then you would be better off reaching for the package mode through Mu. However the Custom LUT Menu mode already listens for and responds to the "source-group-complete"  event. Is there some simpler way you can do what you want during the execution of the mode's sourceColorSetup? You could always set custom properties on the RVSourceGroup from your modified source_setup and access those settings from the Custom LUT Menu mode package's sourceColorSetup. I would pass my info that way. Please tell me if that makes sense.

    Thanks,
    Jon

  • 0
    Avatar
    Derick Dressel

    I followed your advice and added an attribute to the RVSourceGroup.  Works like a charm!

     

    Thanks a bunch!

     

     -derick

     

     

     

  • 0
    Avatar
    Jon Morley

    Awesome! Thank you for letting us know.

Please sign in to leave a comment.