Nuke Draft Failing with incorrect file padding

I have a Nuke job with a dependent Draft job. The filename in nuke is built through TCL and works fine in the render. It even looks like it is getting passed properly to Draft however, draft is doubling the frame padding and failing making the qt. I’m not sure if the TCL in the write node could be affecting this, but the line to build the filename looks like this:
[value root.nim_basename]_v[format %02d [value root.nim_version]][ if { ![string equal [string trim [value nimCompTag] " "] “”] } {return _[string trim [value nimCompTag] " "]} ].####.jpg

It looks like everything is getting passed properly until you see where it fails in the log.

Here are the Job Info Parameters for Draft:
Name=TST_001_COMP_nukeWrite_v05.nk [DRAFT]
Plugin=Draft
OutputDirectory0=I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\Draft
OutputFilename0=TST_001_COMP_nukeWrite_v05.0001.mov

Here are the Plugin Info Parameters:
scriptfile=R:/Draft/Templates/NIM_Draft_Dailies.py
ScriptArg5=frameList=1-100
ScriptArg6=startFrame=1
ScriptArg7=endFrame=100
ScriptArg8=inFile=“I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\TST_001_COMP_nukeWrite_v05.0001.jpg”
ScriptArg9=outFile=“I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\Draft\TST_001_COMP_nukeWrite_v05.0001.mov”
ScriptArg10=outFolder=“I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\Draft”
ScriptArg11=deadlineJobID=53b3656f12f5570d6caec2fa
ScriptArg12=

And then here is the log…

Full Log

0: STDOUT: frameList=1-100
0: STDOUT: startFrame=1
0: STDOUT: endFrame=100
0: STDOUT: inFile=I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\TST_001_COMP_nukeWrite_v05.0001.jpg
0: STDOUT: outFile=I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\Draft\TST_001_COMP_nukeWrite_v05.0001.mov
0: STDOUT: outFolder=I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\Draft
0: STDOUT: deadlineJobID=53b3656f12f5570d6caec2fa
0: STDOUT: deadlineRepository=R:\Repository
0: STDOUT: taskStartFrame=1
0: STDOUT: taskEndFrame=100
0: STDOUT: Traceback (most recent call last):
0: STDOUT: File “C:\Users\render\AppData\Local\Thinkbox\Deadline6\slave\R03\jobsData\53b365a3249cdf088419e36a\NIM_Draft_Dailies.py”, line 37, in
0: STDOUT: inFrame = Image.ReadFromFile(inFile)
0: STDOUT: RuntimeError: src\file_io\magick_file_io.cpp@330.frantic_image::file_io::magick_file_io::read_file - Magick: UnableToOpenBlob `I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05\TST_001_COMP_nukeWrite_v05.00010001.jpg’: No such file or directory @ error/blob.c/OpenBlob/2643
0: INFO: Process exit code: 1

I can see that a Draft submission that works does not include the frame number in the input:
ScriptArg8=inFile=“I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_manual\TST_001_COMP_nukeWrite_manual.####.jpg”
ScriptArg9=outFile=“I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_manual\Draft\TST_001_COMP_nukeWrite_manual.mov”

Here’s the section of the Draft template that is failing:
inFilePattern = params[‘inFile’]
startFrame = int(params[‘startFrame’])
endFrame = int(params[‘endFrame’])

pull the output width height from an input frame

frameNumber = startFrame
inFile = ReplaceFilenameHashesWithNumber(inFilePattern, frameNumber)
inFrame = Image.ReadFromFile(inFile)

Any ideas on what may be causing this?

Thanks,
Andrew

A little follow up to that…

A manually entered nuke write node will show this in the submission parameters:
OutputDirectory0=I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_manual
OutputFilename0=TST_001_COMP_nukeWrite_manual.####.jpg

The gizmo based write node is showing me this:
OutputDirectory0=I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v05
OutputFilename0=TST_001_COMP_nukeWrite_v05.0001.jpg

I see that the problem is what Deadline thinks the output filename is.
Where is deadline pulling the OutputFilename from?

**
I archived the 2 jobs and in the job.json I see the difference…
WORKING
“Plug”: “Nuke”,
“OutDir”: [
“I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_manual”
],
“OutFile”: [
“TST_001_COMP_nukeWrite_manual.####.jpg”
],

NOT WORKING
“Plug”: “Nuke”,
“OutDir”: [
“I:\PRJ\0_NIM_TEST\NIM\IMG\TST_001\COMP\TST_001_COMP_nukeWrite_v07”
],
“OutFile”: [
“TST_001_COMP_nukeWrite_v07.0001.jpg”
],

Sorry for all the posts, but I figured out a work around…

The problem was that the write node’s file knob had TCL pointing to user defined knobs that also included TCL… ie
Write
file: [value myFilepath]
User:
myFilepath: [value root.filePath].####.jpg

If I move the code from the knob on the user tab directly into the file knob then it resolves properly… Not sure why this would be. Seems like it could be that when you guys are querying the file it is fully evaluating the variable on the user tab and then injecting into the write tab… This is probably just how Nuke resolves things, but I guess good to know if it pops up again.

thanks…
Andrew

Hello Andrew,

Thanks for the updates, always good to see the process to solution, not just the problem and result. :slight_smile: