In a post on Ask Autodesk this week, we were asked about the camera shake attributes that you can find on the cameraShape node, in the Attribute Editor. They are new in Maya 2009.
This is what you would have seen in the Attribute Editor for a cameraShape in Maya 2008.
And here's what you now get in Maya 2009.
Note that this is a 2D Shake. This is not the kind of camera shake that you get from moving the camera around, If you want to simulate that, you would want to do that on the transform node of the camera. These are offsets on the film back.
What we did is add additional offsets to the existing camera offsets that can be used together.
For example, observe that an offset of -1, -1 and shake of 1, 1 cancel each other out.
I like turning on the Display Film Pivot and Display Film Origin Attributes to see the offsets more clearly in the viewport.
The Overscan is different from the normal overscan that shows you more of the scene around the film gate, but does not affect the rendering. Camera Shake overscan does change what you see in the rendering, because it is a multiplier to the film aperture. If you never gave this any thought before, now is a good time to do that. The film aperture specifies how large the film is (the units are in inches). If we use the same lens, but make the film larger, say we replace a 35mm back with a 70 mm back, we see much more of the scene. The angle of of view has now changed. This is effectively what camera shake overscan ends up doing but without touching the film aperture itself.
The documentation has a section on camera shake at http://download.autodesk.com/us/maya/2009help/files/View__Camera_Attribute_Editor.htm, but it doesn't really tell you how to use it. If you enable it, set the offset and press play for example, nothing happens. You either need to animate the offset, or write an expression.
I'll start really simple, by adding some Vertical Shake with a very basic expression. I want something like what I used to call film jitter (I used to work as a projectionist when I was a student). This is an effect that you may see in old prints of a film where the registration of the film is off, because the sprockets that move the film through the projector are worn or because the perforation is damaged.
A random function wouldn't work so well, because it would be all over the place, but a noise function driven by the current frame might work because it is a lot less irregular. The image below shows the difference between random (white) and noise (red).
So I simply type
noise(frame) in the field for perspShape.verticalShake, in the Attribute Editor and play that back. Ouch! That's WAY too much. I need to tone that down quite a bit. Open the Expression Editor and change the expression to
That's better, but it's still much too fast, the frame value is changing too much, so I make one last tweek and divide the frame value to reduce the frequency of the noise function.
Now I'd like to add some weave (horizontal movement of the film) and copy the expression, so that I have
This gives a really bad diagonal motion, because horizonatl and vertical offsets are now the same; I'll offset the frame for the noise function by 50 and make the horizontal motion a bit slower, like this.