Sunday, June 7, 2009

Camera Rig

Hello everyone, I'm coming off of vacation and heading back to work tomorrow...I figured I'd post something before things get busy again.

I found this shaker script a while back and decided to make a camera rig out of it. I find it useful for throwing in some quick camera shakes. Of course, if you have time, you should hand key a bit of the rotate channels as well.

  • Tilt the camera with the "up_CON" controller, the "tilt" attribute on "CAM_CON", or the Z rotate channel on the main controller.
  • "Zoom" attribute actually trucks the camera in closer (doesn't affect focal length). It was added out of necessity. There were times when we wanted to experiment with different versions of a shot--bring the camera in close or keep if out further.
  • "Frequency" regulates how fast the jitter is.
  • "Ampitude" regulates how big each shake is.
  • "Phase"--honestly, I've never use this.
  • "Flash"--one of my cheap tricks to get a screen flash.
  • Contrain the parent of "up_CON" or "aim_CON" if you want it to follow a target (I tend to not constrain, though...still experimenting).
  • "CAM_noise" is keyable. For lack of a better name, it's to layer in extra camera "noise".
  • Visiblity switch is found on "Master_VisibilityShape" node (select "CAM_CON" then look in channel box").


I found that it may be difficult to "undo" in Maya once you press play with the camera rig in your scene. This is due to how to the shake feature is set-up.

Here's my work around:
I toggle the "Shake" expression on and off, depending if I'm working on the camera or not.

Use this mel to turn it off:
  • expression -e -s "" -o noise_MD -ae 1 -uc all Shaker; print "Shake off!";
Use this mel to turn it on:
  • expression -e -s "noise_MD.input1X = (noiseX.outColorR -.5) *.2;\r\nnoise_MD.input1Y = (noiseY.outColorR -.5) *.2;\r\nnoise_MD.input1Z = (noiseZ.outColorR -.5) *.2;\r\n\r\nfloat $valeur = `getAttr (\"CAM_CON.frequency\")` *2;\r\nfloat $phase = `getAttr (\"CAM_CON.phase\")`;\r\n$valeur += $phase;\r\nsetKeyframe -v $phase -at \"time\" -t 0sec CAM_shaker;\r\nsetKeyframe -v $valeur -at \"time\" -t 4sec CAM_shaker;\r\n\r\nnoiseX.time = CAM_shaker.time + 5;\r\nnoiseY.time = CAM_shaker.time + 10;\r\nnoiseZ.time = CAM_shaker.time + 20;" -o noise_MD -ae 1 -uc all Shaker; print "Shake on!";

Make shelf buttons for these commands or do what I do and make them buttons on your Picker.

Have fun, but don't holler if you cant undo in Maya cause you forgot to turn the "Shake" expression off! I had to learn the hard way:)


jeff said...

tj...have you messed with animation layers in 2k9 yet? i've been having some great results doing my shake on a layer> Thanks for posting...i'll definitely check this out!

TJ Phan said...

i haven't made the jump to 2k9 yet. i'm itching to try out the layers though.

quick question--to make use of the layers, do the rigs have to be set up in a specific way, or will the layers work with any rig?

renato polimeno said...

Hello TJ,
I´ve tested it and it is a nice camera rig indeed!

I´d like to share with you mine:

Hope you find it usefull at some point and feel free to contact me at any time.


TJ Phan said...

Thanks Renato! I'll definitely give it a go next time I get the chance.

I'm always looking for better ways to do things. It's been a while, but since this post, I've been trying out a few different shake set ups.

I'll have to update mine once I find some free time.

Definitely appreciate you sharing!