Shake tip: The TimeX node
The TimeX node is one that people are either terrified by or ignorant of how it works. If you’re not afraid of it, then you shouldn’t be usingit. I’ve seen numerous scripts completely collapse around someone’s ears (often my own…)
It’s a bit like any other extreme sport - if you have respect for what it can do to you and your script, you should be safe.
There are two main issues that the TimeX node presents - unexpectedly changing the time, and keyframes.
-
Changing the Time
To understand what’s happening here, you’ve got to understand how Shake works internally. Shake is a bottom-up system. When a node needs an image, it says to its inputs “You need to give me an image at time X. I need THIS part of the image, and I want you to give me THESE channels”. These values work their way up the tree - each node will either pass them on or modify them in some way (a Reorder node would change the channels, a Transform node would change what part of the image is needed, and a TimeX node would change what time is wanted). Nodes with more than one input will pass it on to whichever inputs it needs, until the request reaches an input node (SFileIn, RotoShape, etc). The input node will then do its thing, reading the file, or generating an image from scratch, and will then pass this image back down.
Every time a node gets an image returned to it, it will do whatever it needs to do to that image, before passing it on to whoever called it. For a single node at a certain time, there is only one output. If there are two outputs requesting different things (different channels, for example), then it will ask its inputs for everything it needs, and then pass on whatever needs to be passed on.
I’m sure you can see the problem with this method… If one input asks for an output at time X, and another one asks the same node from an output at time Y, then what does it do? It can only give one image output (which is fine for different channels, but not for different times). I have no idea how it actually chooses, but it always seems to go with whichever one has the TimeX node on (if there are two TimeX nodes, it seems to go with whichever one was created first).
If you wanted to do some kind of fake motion-blur, you might think that you’d be able to do something like this:

with “time-1″ in the “newTime” parameter of the TimeX node. This, however, won’t work - all you will get is the whole thing at “time-1″. Try it yourself - if you don’t have any footage around, use a Text node with “%F” as the text (this shows the frame number).The solution to this is this:

Even though the two SFileIn nodes are identical copies of each other, because they are still different nodes, they can cope with passing out different images.The essential thing to remember about wiring in a TimeX node is to keep the node-tree above the TimeX node completely seperate from the node tree below. The only way anything should be able to get from above it to below it is through the TimeX node.
-
Keyframes
If you have a node with on-screen-controls, the on-screen controls will always show what the node should be outputting at the current frame, and will ignore any TimeX node that may be affecting it. When you move them, though, you’ll actually be changing the parameters at the time that is affected by the TimeX node. What this means is that the on-screen controls will seem to be acting very strangely. Sometimes you’ll grab something and the image will change, but the on-screen controls will be stick in place. Whichever way it goes, it is sure to confuse you the first few times. Once you realise what’s going on, you’ll start to pick up on what is acting strangely. I don’t really have a ’solution’ to this one - just make sure you’re aware of what the TimeX node could be doing to your script.
All that said, the TimeX node can be really useful. I find I use it mostly when I need to do something like showing only every other frame, for 2 frames each. (”(floor((time-1)/2)*2)+1″ will give you frames 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, etc, giving a stop-motion-like effect.)
Let me know if there’s anything you don’t understand in here, or if you think I’ve got something horribly wrong!
November 12th, 2007 at 20:05
[…] Water Droplets The TimeX node Working with interlaced footage Cartoon ’shader’ in Shake Concatenation Fixing crashed Quick Paint Nodes […]