AutoWrite v1.0
This location is for Registered Users Only.
Perhaps you need to login or register.
6.0, 6.1 or later
Linux, Mac, Windows


AutoWrite
Semi-automatic output paths for Write nodes in Nuke.
The gist:
Create output paths by parsing the Nuke script name and path.
Most of the information needed for the output of a Nuke script is contained in it's name. We can reduce manual name changing on behalf of the artists and simultaneously increase consistency by creating a Write node that creates (and updates) it's own output path by parsing the script's name.
The details:
Most projects at a facility will use a standardized file hierarchy, which means that a Nuke script's name and path on the filesystem will often contain all the information needed to define the output destination for it's render. As an example, here is a path from one of my comp scripts:
/Volumes/PICO/show/testproj/abc/abc123/nuke/abc123_comp_v01.nk
From this path, we can see that I have a project called "testproj" that has a sequence with an abbreviation "abc" and that there is a shot called "abc123" in that sequence. I am working on composite version #1 on that shot.
What I do to create an AutoWrite is add a tab to the Write node where I break down these path elements in four knobs: project root, sequence name (or abbreviation), shot name and script name. These knobs are then re-assembled to create the AutoWrite's output path.
Since each facility creates their own file structure, I have set it up for my own structure and I leave it to you to parse your own paths for your facility.
Installation:
Put this script in your Nuke path and add this line to your menu.py: import autowrite
Important note:
Because this node creates paths that don't yet exist on the filesystem, you'll want to implement the beforeRender callback listed in the Nuke manual (page 575 for Nuke 6.1v2.) That way your auto-generated output paths get auto-created on render and life stays groovy.
LICENSE
Copyright (c) 2010 Tim BOWMAN
Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions: The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Comments
Yes, it also occurs when i use a regular write node. Previously I only encountered this problem when rendering exr. But now it also happens when writing tga.
def createWriteDir( ):
import nuke, os
file = nuke.filename(n uke.thisNode())
dir = os.path.dirname ( file )
osdir = nuke.callbacks. filenameFilter( dir )
os.makedirs(osdir)
nuke.addBeforeRender(createWriteDir)
When I remove the init.py everything runs normally, but then I would have to create the directories manually, right?
Cheers,
Anselm
Appearently it's not overwriting the file that's the problem. It's creating the path. By os.makedirs(osd ir) Nuke tries to create a path that already exists. So the solution is to put
if not os.path.isdir(o sdir): os.makedirs(osd ir)
instead.
regards,
shin
You install the autowrite script according to the manual given above. Then you put these lines into your init.py :
def createWriteDir( ):
import nuke, os
file = nuke.filename(n uke.thisNode())
dir = os.path.dirname ( file )
osdir = nuke.callbacks. filenameFilter( dir )
if not os.path.isdir(o sdir): os.makedirs(osdir)
nuke.addBeforeRender(createWriteDir)
The lines 2 to 6 are indented (=moved to the right, ? my english is not so good ?) by one tab. Otherwise they might not work.
Usually the .Nuke folder is located in your users directory.
Hope I could help you. I'm also still a newby to Nuke...
I also changes some lines in the autowrite script to make it fit to my folder structure. But that is quite simple, just read the lines carefully and you will find out what they do in detail.
To make changes work you need to restart Nuke.
Regards,
Anselm
Is that what you wanted to know?
My write nodes file path for example is [join [lrange [split [value root.name] / ] 0 3 ] / ]/03_Output/01_ WIP/[value script]_[value views]/[value script]_[value views].d.tga
name 'autowrite' is not defined
Traceback (most recent call last):
File "
NameError: name 'autowrite' is not defined
any clue for this :-))
thank you for ur amazing superb script
i am using 6.3 v4
(for .dpx render format)
colorspace raw data should be on
&
transfer should be log
what shd i add into the script ?
That is all done in my comp... u'll find the codes for raw data ON and transfer to log.. check in my PC...
Stay awesome!
RSS feed for comments to this post