Right, but if you’re switching "contexts" in the middle of a Nuke session, you 
could be talking about trying to swap out builds of certain plugins, which 
*will* crash Nuke if they have already been loaded.

I can understand doing this once when a Nuke script is loaded, but I wouldn’t 
ever consider a Nuke session "reusable"... once you open a script, it’s very 
difficult to get it back to a "clean" enough state that it could be treated as 
a fresh process (it used to be impossible, and if you’re trying to swap out any 
loaded plugins, it’s probably as close as makes no difference).

If all you need to do is make some decisions based on the script that’s being 
loaded, why not just install an onScriptLoad callback, parse the appropriate 
show/shot out of the incoming path, and pass them to a bootstrap function 
somewhere to take care of the modifications to the environment, plugin path, 
etc? No need for any init or menu files or exec-ing.


-Nathan



From: Jesse Kretschmer 
Sent: Tuesday, October 01, 2013 4:38 PM
To: Nuke Python discussion 
Subject: Re: [Nuke-python] Late loading of init.py and menu.py for plugins

On Tue, Oct 1, 2013 at 3:08 PM, Nathan Rusch <nathan_ru...@hotmail.com> wrote:

  I’m a little confused though... are you trying to alter the available plugins 
in the middle of a Nuke session, after having potentially already used some of 
them? What is it that would prevent you from making the appropriate plugins 
available right out of the gate?

I'm not trying to remove any plugins or features, but add them. At my studio, 
we are able to switch project/show context from within nuke. I then want to 
execute the init.py and menu.py each time the context is switched. My current 
workaround is functioning, but it feels hackish.

I have seen many studios have strict show/shot context that must be set before 
the application is launched. That would be a great solution, but the 
expectation for a dynamically set context seems to be paramount and I'm still 
the new guy.


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

Reply via email to