Project Directory in Nuke
It is only after joining trollbridge I realize how using project directory can make things easy in nuke, especially in a big script with lots of files. It makes transporting the folder significantly easier as you only need to change one path as you move the folder. If using relative file path in project directory and make sure all the files in script are set properly, you pretty much eliminate the process of relinking files. Which leads me to writing this script. This script allows users to set project directory with ease, converting file paths to relative file paths in the progress.
- absFilePaths: Which will convert your selected nodes' file paths (if has any) to absolute file paths, without affecting frame padding.
- selNodeWithFile: Select all the nodes with a file knob, this works extremely well with absFilePaths for me as sometimes I just want to make everything absolute for compatibility issue.
Writing this script I learned a lot about using nuke callbacks, especially when writing the function above, adding file paths relative to where the nuke script is located when a script is opened. I also realize that there are shortcuts to writing codes for nuke. For instance there are already a lot of pre-built functions hiding inside nuke python API module. Like I was attempting to write a function that create a list of nodes that contain a file knob, only to realize there's already a function in nukescript.searchreplace module that does just that. Which I used extensively in this script.
This script is available for download on nukepedia here. In there you can find the short installation guide and any updates I'll put up there!