I tried that - it sources my menu.py before loading scripts from the command-line, so root().name() is always "root" when you check...
On 17 February 2012 05:46, Ben Dickson <[email protected]> wrote: > Can't you just check if nuke.root().name() != "Root"? > > On 13/02/12 22:12, Colin Alway wrote: > > hi, > > > > does anyone know if this is 'safe', or if there's a better way to do it? > > > > i want to execute some code in my menu.py depending on whether nuke has > > been started up 'clean' or with a nuke script to load. > > i found nuke.rawArgs is a list of the command-line args, so i have > > something like this: > > > > for item in nuke.rawArgs: > > if item.endswith('.nk'): > > print 'script on command-line found' > > > > but is there a better way? > > > > thanks > > colin > > -- > > colin alway > > > > > > _______________________________________________ > > Nuke-python mailing list > > [email protected], http://forums.thefoundry.co.uk/ > > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > > -- > ben dickson > 2D TD | [email protected] > rising sun pictures | www.rsp.com.au > _______________________________________________ > Nuke-python mailing list > [email protected], http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > -- colin alway
_______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
