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?