View Full Version : Set Projects

01 January 2012, 08:38 PM
I recently started learning Nuke. I am currently learning through tutorials and the problem I am facing is a number of the files have reads that don't show up because the directory is wrong. Is there any way to set the project to the projects and footage folder automatically?

I am hoping for something similar to how images in a Maya file can be automatically connected/reloaded to the sourceimages folder just by setting the project to a Maya projects folder.

01 January 2012, 01:58 PM
Paste the following into Nuke:

set cut_paste_input [stack 0]
version 6.2 v2
push $cut_paste_input
NoOp {
name ProjectPath
tile_color 0xb51251ff
label "\[value ProjectPath.Project]"
note_font_size 20
selected true
xpos 460
ypos 10
hide_input true
addUserKnob {20 User}
addUserKnob {2 Project}
Read {
inputs 0
file "\[value ProjectPath.Project]"
origset true
name Read1
selected true
xpos 460
ypos 60

01 January 2012, 09:04 PM
Thank you for the response, but where exactly do I need to post that script into?

01 January 2012, 10:50 PM
If you copy/paste Ringas' script right into the node graph it will create two nodes for you, a NoOp which will allow you to browse to a directory to set your project path and an empty Read node which links to the NoOp for the path so theoretically you would just have to add the filename if your sources are in the same folder as your nuke script. Of course you would have to add any subfolders if they exist. This would be one way to set up a script so that you would only have to change the path in the NoOp to update all your Reads.

In your case, if I understand you correctly, you are trying to fix the sources for pre-existing Reads in your tutorial scripts and the easiest way to do that is to use Nuke's built-in search and replace function. (Edit > Node > Filename > Search and Replace...) or hotkey Ctrl+Shift+/.

With all your reads selected, you would enter the current (non-working) path into the search box (Ex: //Users/name/projects/nuke/coolshot/) and the proper path (Ex: C:\\Users\name\nukestuff\coolshot\) or whatever it happens to be. This will hard-set the new path so you will face the same issue if you move the files again which is where Ringas' script could come in handy. Instead of using an absolute path, copy/paste his script and then put [value ProjectPath.Project]/ into the Replace field.

Alternatively, if your sources are located in the same folder as your nuke script, you can skip the NoOp altogether and Search and Replace with [file dirname [value] ]/ instead.

So the final file path in your read would look something like this: [file dirname [value] ]/mysources/neatsource.exr

Hope this makes sense!

CGTalk Moderation
01 January 2012, 10:50 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.