Wednesday, November 16, 2011

Camera Switching Script

$currentCamera = `lookThru -q`;
string $allCameras[];
$allCameras = `listCameras`;
int $nextCamera;
for($pos=0;$pos{
if($currentCamera == $allCameras[$pos]) $nextCamera = $pos+1;
}
if($nextCamera>=size($allCameras)) $nextCamera = 0;
lookThru $allCameras[$nextCamera];

If we wanted to toggle backwards we would make the following modifications;

$currentCamera = `lookThru -q`;
string $allCameras[];
$allCameras = `listCameras`;
int $prevCamera;
for($pos=0;$pos{
if($currentCamera == $allCameras[$pos]) $prevCamera = $pos-1;
}
if($prevCamera<=0) $prevCamera = size($allCameras)-1;
lookThru $allCameras[$prevCamera];


Mel script for Undo keys and not the frame:
//forward
undoInfo -stateWithoutFlush off;
playButtonStepForward;
undoInfo -stateWithoutFlush on;

//back
undoInfo -stateWithoutFlush off;
playButtonStepBackward;
undoInfo -stateWithoutFlush on;


AM Newsletter June-July 2012
http://info.animationmentor.com/index.php/email/emailWebview?mkt_tok=3RkMMJWWfF9wsRonuanIZKXonjHpfsX56%2B0pXqWg38431UFwdcjKPmjr1YsARNQhcOuuEwcWGog8wQJRF%2BGBdY9O9%2FBTH06g

No comments: