Monday, August 18, 2014

Resetting the pan zoom on a Maya camera

This seems to come up all the time.. so I'll share a quick script for resetting the pan and zoom of your current camera.
 for those that are interested, the settings for Pan and Zoom are on the camera's shape node under 2D Pan/Zoom 



























 so the script just gets current camera from the current active panel and sets the channels

save it your /scripts and add it to a hokey/shelf/marking menu..

// resetPanZoom.mel
// stephenkmann@gmail.com
// resets the pan zoom of the current camera
global proc resetZoom()
{
string $activePanel=`getPanel -wf`;
string $cam = `modelEditor -q -camera $activePanel`;
string $camShape[] = `listRelatives -c -s $cam`;
setAttr ($camShape[0] + ".horizontalPan" ) 0 ;
setAttr ($camShape[0] + ".verticalPan"  ) 0 ;

setAttr ($camShape[0] + ".zoom") 1;

}
//----------------------end-------------------------------


1 comment:

  1. Công Ty TNHH Tin HỌc Gia Hào

    Lắp đặt camera quan sát
    Lắp đặt camera quan sát giá rẻ

    Camera quan sát

    ReplyDelete