Ah OK, I didn’t realize you wanted this to happen when an empty Nuke session was started as well. In that case, you should be able to use a combination of the Root’s `onUserCreate` callback (which is only called once when an empty session is started), and `onScriptLoad`.
-Nathan From: Tony Barbieri Sent: Thursday, March 13, 2014 9:51 AM To: Nuke plug-in development discussion Subject: Re: [Nuke-dev] Open file on startup The onScriptLoad callback doesn't seem to fire when launching. I'm adding the onScriptLoad callback in the init.py but it doesn't seem to "take" until I open a script after Nuke has launched. Trying to use the onCreate callback also doesn't seem to work as I am trying to open a script while everything is still instantiating. Not really sure how to proceed with this at this point. On Mon, Mar 10, 2014 at 3:29 PM, Tony Barbieri <great...@gmail.com> wrote: Thanks for your reply, Nathan. This seems like the most straightforward way to accomplish this. Thanks again! -tony On Mon, Mar 10, 2014 at 1:06 PM, Nathan Rusch <nathan_ru...@hotmail.com> wrote: The `onScriptLoad` callback runs after the Root’s `onCreate` callback, which should be the last `onCreate` to run when a script is loaded. -Nathan From: Tony Barbieri Sent: Monday, March 10, 2014 7:58 AM To: nuke-dev@support.thefoundry.co.uk Subject: [Nuke-dev] Open file on startup Hello! I am trying to open a file on startup by using a custom open method written in python. I am trying to run the open code either in an init.py or menu.py that we use for our facility. Ideally this can happen in the init.py. The code appears to be running correctly but it seems that the file is zeroed out to a default scene due to it running "too early". Is it possible to open a file on Nuke launch without using the standard command-line file flag but do it via python? Thanks! -- -tony ---------------------------------------------------------------------------- _______________________________________________ Nuke-dev mailing list Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev _______________________________________________ Nuke-dev mailing list Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev -- -tony -- -tony -------------------------------------------------------------------------------- _______________________________________________ Nuke-dev mailing list Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
_______________________________________________ Nuke-dev mailing list Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev