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.
Doing this gives me two markers in the viewport; the crosshairs represent the pivot, the circle the origin.
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
perspShape.verticalShake=noise(frame)/200.0;
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.
perspShape.verticalShake=noise(frame/10.0)/200.0;
Now I'd like to add some weave (horizontal movement of the film) and copy the expression, so that I have
perspShape.horizontalShake =noise(frame/10.0)/200.0;
perspShape.verticalShake=noise(frame/10.0)/200.0;
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.
perspShape.horizontalShake =noise((frame+50)/20.0)/200.0;
perspShape.verticalShake=noise(frame/10.0)/200.0;
Will this work with 2011? I've trie but the expession commands are different and it is very fast.
Posted by: [email protected] | 31/05/2011 at 02:49 AM
Knowing they exist is enough, anything more than that would be a bonus.
Posted by: John Cocks | 06/04/2009 at 05:25 PM
I'll bring that up as a suggestion for the release notes. I'm not sure if it is feasible right now, because if we had the resources to document them we would just document them, not release note them as undocumented, but I agree that there is value for you in knowing about these changes.
Posted by: Michiel Duvekot | 06/04/2009 at 05:01 PM
I think it would be a good idea if there was a page in the help that listed the features that were in Maya but which are at this time undocumented/untested/unsupported with a nice big disclaimer stating such.
Posted by: John | 06/04/2009 at 04:53 PM
The Camera Shake attributes were added in Maya 2008. And you're right, this happens quite a bit. When we make these decisions, we have a choice to leave them out completely, or leave in some undocumented and untested and unsupported features. I think that having them in there is better for most people.
I'm sure this will continue to happen, so you'll probably see some more hidden features being mentioned on this blog.
Here's a MEL command that will enable the mental ray production shaders for example:
optionVar -sv "MIP_SHD_EXPOSE" 1;
(You need to restart Maya after executing this command.
I'll write more about that in an upcoming post.
Posted by: Michiel Duvekot | 06/04/2009 at 04:17 PM
Here's what stinks. Camera shake has been in maya for quite some time, but it was only till 2009 did they made any sort of controls for shake (As part of the camera command). But the makers of maya seem to do this all over the place, just like what appears to be stereo support for dual camera rigs in 2008, but no controls for them till 2009.
Posted by: Kevin Edzenga | 06/04/2009 at 08:06 AM