So easy ... thanks Ron! 

JCK 

----- Original Message -----
From: "Ron Ganbar" <[email protected]> 
To: "Nuke Python discussion" <[email protected]> 
Sent: Monday, August 6, 2012 12:05:49 PM 
Subject: Re: [Nuke-python] menu.py menubar shared for multiple users 


You just need to place your menu.py in a centralized location that is 
accessible from all users (and all the gizmos, icons, scripts, etc, as well). 
Then in each individual home directory create an init.py file where you can use 
the following script to point to the centralized location: 



import nuke 


nuke.pluginAddPath('path/to/centralized/location/') 



Enjoy, 
Ron Ganbar 
email: [email protected] 
tel: +44 (0)7968 007 309 [UK] 
+972 (0)54 255 9765 [Israel] 
url: http://ronganbar.wordpress.com/ 



On 6 August 2012 18:52, Jonathan King < [email protected] > wrote: 




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 



_______________________________________________ 
Nuke-python mailing list 
[email protected], http://forums.thefoundry.co.uk/ 
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python 
_______________________________________________
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