Write
The Write node is where the result of the script is rendered out. This may be formatted as a .mov file, or as an image sequence. The way that this node works is simple but a bit weird for the newbie: the user must first press the little folder icon next to the 'file' value, then navigate to Where you wish the result to be rendered. The name of the output must be followed by the file extension of the format (.mov, .tga, .tiff etc). Once this is in place, the parameters in the Read node will expand to include those that are specific to that format. /
In any write operation, the 'frame range' parameter should be specified. This is set after the 'Render' button has been pressed and the render dialogue box pops into view. In the screen shot below, a frame range of 1 to 600 has been set.
In this example the 'file' parameter box specifies the file path: /Users/XIUJUN/Documents/Compositing/Renders/FileName.mov. This denotes the place to where you wish to render (i.e. /Users/XIUJUN/Documents/Compositing/Renders/), the name of the file (i.e. FileName) and the filetype (i.e. .mov). See below for what this would look like in the case of an image sequence. Remember to observe the file naming conventions, as outlined in the Project Management page.
Contents
Single frame
When rendering a single frame, set the 'Frame range' to a single frame (e.g. 37-37).
Image sequence
An image sequence is a movie rendered out as many individual images. Compositors prefer image sequences as read files, as they are less prone to render errors. Also... An image sequence render can fail half way through without loosing all the render data. All you need to do is to to re-start the render from the frame at which it failed. The images in an image sequence are sufixed by the frame number. In order to specify this number, the name of the render file has to be sufixed with a 'padded' number, like this: 'file_name_####.tga'. This will render out a sequence that begins: file_name_0001.tga, file_name_0002.tga etc.
By the way, Adobe's Premier supports image sequences, but Final Cut Pro does not.
Render with/without alpha
The default render from the Write node lacks an alpha. This can be changed in the 'channels' parameter. However: the only movie format that supports an alpha is animation, set to render at 'millions of colors plus', which is found in the advanced parameters. Usually, if an alpha is required, it is best to use an image sequence instead.
Donʼt use absolute file paths
An absolute path is one that specifies the location of the file with respect to the computor e.g. My_Computer/school/lesson_one/asset.JPG. A relative path is one that defines the location relative to a file or a folder.
When reading and writing files, this course expects you to (as much as possible) use paths that are relative to the Nuke file. An absolute path 'breaks' when the project folder is moved to a new computor, and each filepath will then have to be manually repaired. A relative path, on the other hand, is far more durable.
There are two flavours of relative paths: those that look 'downstream' (i.e. into the same folder in which the Nuke file is located, or other folders within it) or 'upstream' (i.e. in the parent folders of the folders in which the Nuke file is located).
For downstream, the following relative filepath is recommend. This writes or reads into a folder called 'sources', which is located in the same folder as the Nuke file. The image below illustrates this relationship.
[file dirname [value root.name]]/sources/Asset_Name.JPG.
For upstream, the following relative filepath is recommend. This writes or reads into a folder called 'comp-out', which is located 'upstream' to the Nuke file. The image below illustrates this relationship. To go further upstream, the value end-n needs to be increased.
[join [lrange [split [file dirname [knob root.name]] "/"] 0 end-1] "/"]/comp-out/01_01_qua_v1.jpg
If by chance, you are keeping the footage on a network drive far away from your Nuke script, then the relative path method won't work as there will be a 'breakage' between the Nuke file and the source/write file. Instead of manually changing each node, you can configure a NoOp node so that it is referenced by the Read and Write nodes. The snippet below explains how this is done.
Press 'Expand' and select and copy everything below this line, then paste into the Nuke node graph.
set cut_paste_input [stack 0] version 9.0 v7 StickyNote { inputs 0 name StickyNote7 label "<pre><b><-- This Read node refferences the filepath value in the node 'Project_Path' (which is an adapted NoOp node) \n\nInstructions for use: \n\n1) Paste 'Project_Path' into your script. \n\n1) In all your Read and Write nodes, substitute \\\[value Project_Path.filepath] for everything that preceds the filename.\n\n2) In 'file path' of 'Project_Path', navigate to your sources folder\n\nAll Read and Write nodes will now call upon 'file path' of 'Project_Path' when looking for the 'sources' folder." selected true xpos -4012 ypos 65 } push $cut_paste_input NoOp { name Project_Path label "\nPlace in this node the file\npath of your project. " note_font "Verdana Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold Bold" note_font_size 9 note_font_color 0xff selected true xpos -4111 ypos -92 addUserKnob {20 User} addUserKnob {2 filepath l "file path"} filepath /Volumes/Internal_02/School/RMIT_VFX/lessons/lesson_01/01_01_qua/comp/_setup/sources/ addUserKnob {26 ""} addUserKnob {26 directions l Directions: -STARTLINE T "Place here the path of 'top level' folder of your \nproject. If you don't know it drop the folder \ninto the node script and copy it from there \n(it will be in the file parameter of one the \nresulting read nodes)"} } Read { inputs 0 file "\[value Project_Path.filepath]file_name.jpg" format "1920 1080 0 0 1920 1080 1 HD_1080" origset true version 1 name Read3 selected true xpos -4112 ypos 55 }
For a fuller and more comprehensive look at file paths, have a look at this excellent pdf from the excellent Benjamin Seide.
Render misc
If, when a render is attempted, Nuke tells you that 'You must specify a proxy file name to write to', then the 'Toggle proxy mode' in the 'Viewer' has probably been set to proxy mode. Either un-toggle it, or specify a file path in the 'proxy' parameter. Proxy renders are good for testing the script.