I'm not sure this answers your question but I have a python tool with a built in nuke script which gets populated based on input data, show name etc...
I cant see why you couldn't do this to write a template node populate your changes into this and then auto push it to the users home dir. I also use a template which is central in the specific show ie in one place and this is auto- copied to the home dir. So combining the two should allow you to do what you are after, but then again I'm not the greatest of coders so this may be a lousy approach. Howard > On 2 Dec 2015, at 8:06 p.m., Justin GD <j.grosde...@gmail.com> wrote: > > Den, > > If you look at what I said, you probably would have to override some built-in > classes; > This could work but on a second though, it might be too much to implement for > such a simple thing. > > I think Ron, said to create manually a 'base' nuke script (.nk) on the server. > > Then anytime you want to generate a new script, in python you open that empty > base and create whatever you want. > Then you save it anywhere using nuke.scriptSaveAs(location) > > I think it is a better way finally; > > Cheers, > Justin > > > > > 2015-12-02 18:21 GMT+00:00 Den Serras <denserras...@gmail.com>: >> Thanks Justin! I tried importing hiero from Nuke 9 command line, and got an >> error "No module named _fnpython", and I can't get Studio to launch as >> command line. Have you been able to do that? >> >> Thanks Ron. I am not sure what you mean, however. I'm trying to find a way >> to have Nuke server-side generate the script, so that all the proper configs >> are applied without me having to pre-generate a template whenever anyone >> updates code that would affect new files. >> >> Den >> >>> On Wed, Dec 2, 2015 at 1:59 AM, Ron Ganbar <ron...@gmail.com> wrote: >>> You can create a file on the filesystem and open it all through Python. >>> >>> >>> >>> Ron Ganbar >>> email: ron...@gmail.com >>> tel: +44 (0)7968 007 309 [UK] >>> +972 (0)54 255 9765 [Israel] >>> url: http://ronganbar.wordpress.com/ >>> >>>> On Wed, Dec 2, 2015 at 11:46 AM, Justin GD <j.grosde...@gmail.com> wrote: >>>> Hi Den, >>>> >>>> I guess you could create a nuke script as same as a Nuke Studio nuke >>>> script exporter.. >>>> >>>> >>>> [...]pythonextensions\site-packages\hiero\core\nuke\Script.py >>>> >>>> You have the ScriptWriter class with a method called writeToDisk that uses >>>> nuke.saveToScript( scriptFilename, fileContents ) >>>> >>>> Maybe that could help ? >>>> >>>> >>>> Cheers, >>>> Justin >>>> >>>> >>>> 2015-12-01 16:38 GMT+00:00 Den Serras <denserras...@gmail.com>: >>>>> Hi all, >>>>> >>>>> Due to our pipeline, we have to create the Nuke file for the artist. We >>>>> currently create a template which is duplicated and moved into the >>>>> correct spot, but I'd prefer to do it more dynamically so every time I >>>>> push a change to the setup I don't have to generate a new file. I tried >>>>> launching the CLI and then saving the file, but none of my init scripts >>>>> that actually modify the file seem to be running in the CLI. Don't know >>>>> if I'm doing something wrong or this method won't work. Anyone have a >>>>> dynamic way to create a script, or are those who prebuild scripts always >>>>> using templates? >>>>> >>>>> Thanks! >>>>> Den >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >>> >>> _______________________________________________ >>> 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 > > _______________________________________________ > 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