Monday, December 24, 2012

Pan Zoom Script [Animation]

Wouldn't it be nice if we could just zoom in and pan around in our shot cam without disturbing the camera?

One solution you might know about is Maya's Pan Zoom function:





In which case, you also know that this function sucks hard. Right. But we can build off this!


My script has two parts - in the first part, you will set a button to pan your camera view like you were holding down the spacebar in Photoshop or Flash. You need to set two different hotkey scripts to the same button, one for when the button is first pressed and one for when it's released.














The code for when it's pressed:

    global string $currentTool;
    $currentTool = `currentCtx`;
    PanZoomTool;

And when it's released:

    setToolTo $currentTool;

With this, you can hold down your hotkey and drag the mouse to around your camera view. When released, Maya automatically back to whatever tool you were using before you toggled the script.

We also want to be able to easily zoom in and out.

To zoom in, put this code on a hotkey (I used F1):

    panZoom -zoomRatio 0.9;

To zoom out, use this (I used F2):

    panZoom -zoomRatio 1.1;

To engage and disengage this function completely, all you have to do is toggle the Pan Zoom magnifying glass you see in the first image of this post.

No comments:

Post a Comment