Hi all, 

I might be thinking too simplistically, but I'm trying to create a menubar that 
is shared across multiple users so that we don't have to individually update 
our ~/.nuke/menu.py files each time a new gizmo is introduced. When I import 
the following function and call it, I run into a NameError that menubar does 
not exist. However when the three lines of code are run directly in menu.py, 
they work fine. I can't seem to find any info on where menubar comes from, 
except that it is an instance of class Menu, a class that does not exist in 
python's memory even during a nuke session. Any ideas on how to get this to 
work, or other ways to do the same thing? 

# a function in myLib.py 
def importSharedToolbar() : 
# these three lines work if they are directly in menu.py 
import myNode 
MyToolbar = menubar.addMenu("MyToolbar") 
MyToolbar .addCommand("myNode", "myNode.myFunction()") 


# call made in menu.py 
import myLib 
myLib.importSharedToolbar() 
-- NameError: name 'menubar' is not defined 

JCK 

_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to