Thank you for all your help. I was using it inside other python script and calling it from menu.py and it did not work. nodeClass='Root' is helpful alternative. Once again thank you! Appreciate all your help! Lev
On Tue, May 17, 2016 at 11:11 PM, Frank Rueter|OHUfx <fr...@ohufx.com> wrote: > Hm, what am I missing? The example works fine for me when run through > init.py or menu.py > > Alternatively you could react to the creation of the root to ensure it is > there, e.g. > > nuke.addOnCreate(call, nodeClass='Root') > > > > On 18/05/16 6:07 am, Nathan Rusch wrote: > > There is no callback that runs before a script is about to be loaded. I > have requested this several times in order to allow an OCIO config to be > assigned based on the incoming script path, but it has not yet been > implemented. > > If you want to add your voice to the existing support ticket, it is # > 32400. > > > -Nathan > > > *From:* Lev Kolobov <l...@vfxy.com> > *Sent:* Tuesday, May 17, 2016 10:56 AM > *To:* Nuke-python@support.thefoundry.co.uk > *Subject:* [Nuke-python] Open Comp Path Value > > Greetings, > > Right after user go to File>Open Comp and select any .nk script, I would > like to message user following: > > "Hello dear, you are about to load ../../../....nk script?" > > I got this script in menu.py: > > def path_check(): > nuke.message ('Hello, you are about to load %s script?' % > nuke.root().knob('name').value()): > nuke.addOnScriptLoad(path_check) > > It comes empty.... I guess nuke.root().knob('name').value() is not define > yet... Any suggestion how can I know what path Nuke is about to load? This > is just a simple example, I do not want just to "message" user. I want for > example take a path, split it and set global os.environ before opening nuke > script. > > Thank you, > Lev > > > > _______________________________________________ > Nuke-python mailing listnuke-pyt...@support.thefoundry.co.uk, > http://forums.thefoundry.co.uk/http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > > > -- > [image: ohufxLogo 50x50] <http://www.ohufx.com> > > *vfx for storytellers <http://www.ohufx.com> * > > *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | workflow > customisation & consulting <http://ohufx.com/index.php/vfx-customising>* > * W E L L I N G T O N | N E W Z E A L A N D * > > _______________________________________________ > 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