AWS Thinkbox Discussion Forums

Nuke -t flag and Python interpreter mode

Ok so this might be an odd question, but here goes:
I got a python script, where i open up a nuke script, change a few paths, render out the writenodes and then resave the script. This works excellent in the commandline, and it works on deadline IF i submit it as a commandlineJob withe the arguments Nuke9.3v1 -t helloWorld.py Hello World.
The thing is, this does not seem to work when i submit as a nuke job, i don’t see any of my print statements and the write/readnode-paths is left unchanged.

Anyone know how to deal with this? Or is a commandline job my only option?

Well, we’re already running with “-t” ourselves to control things. How are you running it via the Nuke plugin? Are you passing it in as the script filename?

Are you trying to pass in command line arguments aswell as the path to the script?

FYI. Deadline 8.1 adds the ability to submit a Python Script job to our Nuke plugin, which will load Nuke, open a Nuke script and then execute whatever is in the Python *.py file you give it.

Hi,

sorry for necroposting, but I cannot find any download for Deadline 8.1. We are running 8.0, and need exactly this. So I thought before I jump in and implement it myself, ask around first.
Is there a 8.1 installer, or is this Nuke plugin available somewhere?

Hey @asztalosdani,

take a look at this post: submitting python script as Nuke script.

i wrote it originally for 7.2, tested in 9.0 and used currently in 10.0.
Should fix the problem your getting

Hi @kwatts,

thanks! Your script allows submitting a python script, that nuke will execute and exit, whereas I want to submit a python script along with a nuke script, that will operate on the opened nuke script. I know, I could open the nuke script from python, but I want to keep these scripts as lightweight as possible.

Regarding the 8.1, I went ahead, downloaded 9.0, and scavenged the NukePlugin from there. Upon inspecting it, I found that it runs the python script OR renders the nuke script. But I want to run the python script, THEN do a render. Again, I know, I could do a render from python, but yeah, lightweight scripts and stuff. :wink: So I modified that. I also added the option to submit the python script as an auxiliary file, so it doesn’t have to be on the file server.

Could that work in a pre-render script? Although that does not work in a Nuke context, afaik.

Could you please elaborate on that? What are you suggesting to do in a pre-render script?

Perhaps I don’t understand your case well enough, but you said “first run python script, then proceed with normal render.” My thought was, why not run the python script in a pre- hook of some sort?
There is JobPreLoad (which is certainly not in a nuke context), the plugin has a StartJobCallback method that you might use.
Point being, if you could let the rendering go through the regular path, that might simplify things.

You have to recognize that your use case is advanced enough not to be completely covered by the existing plugins. I don’t get the full picture - do you want to modify the scene using the python script, save it, and then render from it? Or something else?

Hi Mois,

yes, I have to run the script in nuke. Currently I use it to update some read and write nodes, then do a render.

Privacy | Site terms | Cookie preferences