Nuke - file pathing between MAC and Windows

This is probably a Nuke (The Foundry) question rather than a Deadline, but doesn’t hurt to ask.
I have a Nuke file created on MAC. This same file is opened on a Windows PC.

I get read file problems as referenced files within each scene cannot be located.
That is, I have
MAC - /path1/dir1/file1
WIN - \path1\dir1\file1

When I run this through Deadline I was hoping Deadline would pick up these files for reading, but it doesn’t as I get an error of “No such files or directory”.
I have posted this question to the Foundry forum.

Any suggestions from a Deadline point of view?

I’m actually a little surprised that Nuke doesn’t auto-magically figure out the paths. With Deadline 3.0, we’ve done a lot of testing involving rendering Linux scenes on Windows and vice-versa, and the software we used (XSI, Maya, Houdini, etc) would resolve the paths providing they are in the format you’re using.

I did some testing with Nuke 5, and found that a Windows file rendered fine on Linux. But if I tried to render a Linux file on Windows, I ran into the same problem you’re having. So it would appear that as long as the paths are in UNC format (starting with “//”), it should render fine on both Linux/Mac and Windows.

I imagine that Deadline could go through the Nuke file (since it’s just a text file) and ensure that any file paths starting with a single “/” instead start with “//”. It would then save the Nuke file and perform the render. Of course, we would only do this check if the Nuke file is submitted with the job, since we wouldn’t want Deadline to mess around with the original file.

We did our tests with a single input and output node, and both nodes in the Nuke file have a line like this:

file //path/to/input%04d.jpg

So we could search for any line that starts with “file /”, and if that line doesn’t start with “file //”, we make the change. The question I have for you is if you’re aware of any other nodes that use file paths that would have to be checked? If there are others, maybe you could create a single Nuke file that contains all of them and post it. Then we could use this to ensure we cover all possible situations.

Of course, if the Nuke guys know of a better way to get Linux/Mac files rendering on Windows, that would be great! :wink:

Cheers,

  • Ryan

I have been trying to get “The Foundry” to sort this simple Nuke issue, their support is rather ordinary. Once I find a solution, I will definately update this post.

Got an answer:
Had to create a file eg filename_fix.tcl (this can reside in the Nuke plugins folder) with the following content:
nixpath converts to y: and vice versa

if $WIN32 {
proc filename_fix {n} {
puts “filename_fix for Win32 of $n”
set x [regsub “^/nixpath/” $n “y:/”]
puts “filename_fix result is $x”
return $x
}
} else {
proc filename_fix {n} {
puts “filename_fix for unix of $n”
set x [regsub “^y:/” $n “/nixpath/”]
puts “filename_fix result is $x”
return $x
}
}

Update init.py and add:
nuke.load(“filename_fix”)

Also, note that as of 5.0v2 you can do it in python like so:

def filenameFix(s):
nuke.tprint("s was: "+s+’\n’)
if os.name == “nt”:
s = s.replace(’/nixpath/’, ‘y:/’, 1)
else:
s = s.replace(‘y:/’, ‘/nixpath/’, 1)
nuke.tprint("s now: "+s+’\n’)
return s


I can now open mac osx Nuke files in Windows without reference problems.


However, my problem still persist. Since Deadline is not available on MAC OSX, I have to get it rendering on Deadline for Windows. When I submit the Nuke job, it is still giving me grief with no such file or directory because the file submitted contains “/” rather than UNC or mapped network drives.

As far as I know *.nk files are self contained. Although it reads other files or interface with other programs (eg Maya), these gets pulled into the nk file.

Are you able to do the conversion in Deadline v2.7 to convert Nuke paths:
eg Mac OSX - /path1/dir1/file1
to Windows
y:\dir1\file1
or
\path1\dir1\file1

This is something that we could add to Deadline 3.0, but instead of leaving path conversion up to the user, we would much rather just swap “/” for “\” or vice versa whenever necessary. Since the nuke file is just a text file, this would be pretty straight forward. As I mentioned in a previous post, doing this for the input and output nodes would be easy, but we just want to make sure we cover most or all possible nodes that use filenames. We can start playing around with this idea here, but if you know of other nodes that would require this, let us know. A nuke file with all these nodes in it would really help!

Cheers,

  • Ryan

After playing a lot with Nuke on Windows/MAC OSX/Linux, I can assure you that Nuke will convert the “/” to “” or vice-versa “magically”… But it will not add the missing “/” or “” at the beginning of the path.

Cool, thanks for the info!

  • Ryan