nuke
Mirroring animation timing using tcl
To mirror your animation curves, you can use some simple expressions. Let’s say you animated an object from frame 0-50, and now you want to mirror it to frame 51-100.
Just write the following in your specific knob:
1 |
curve(frame >= 50 ? 50-(frame-50): frame) |
This uses the command:
1 |
curve(x) |
which will hold the animation on frame x. So what the above example does, it checks if the current frame is 50 or above. If this is true, it frameholds 50-(frame-50), which at frame 52 for example is …
1 2 3 |
50-(52-50) 50-2 48 |
So on frame 52, it frameholds frame 48. If the frame is under 50, is just gives you your current animated value.
This is pretty useful for creating walk-arounds or anything symmetrical, when you’re too lazy to animate everything. :-)
Copying rendered files to a different folder via python
If you do some versioning on a shot, and want to keep those files in your version-folders, but also want to have a folder that always contains the latest renders, you can do this with python, and don’t have to add a second Write-node in your script.
Just add the following in the after each frame field in your Write-Node.
1 2 3 4 5 6 7 |
import shutil srcFile = nuke.thisNode()['file'].evaluate() folder = os.path.join(path(srcFile).parent.parent) target = os.path.basename(srcFile) destFile = str(folder + "/VLATEST/" + target) if not os.path.isdir(os.path.dirname(destFile)): os.makedirs(os.path.dirname(destFile)) shutil.copy2(srcFile, destFile) |
What this does is the following:
It thinks you render everything in your e.g. “…/output/001/…” – folder.
Then it splits the path and exchanges the 001 by “VLATEST”. If this folder doesn’t exist, it creates the folder.
Then it copies everything over via shutil.copy2().
This script assumes that you don’t have versioning on the filename at the moment. If you want to edit this, you have to adjust your destFile.
Creating Procedural Textures via UV-Map with Expression-Node
To create cool procedural textures in nuke, there is a pretty simple way to do that, all you need is an input image, a STMap-node and an Expression-node. (more…)