Created
February 25, 2017 06:45
-
-
Save kanishk2391/5488058f10cdb1f66593bb108021c50c to your computer and use it in GitHub Desktop.
Switch Cameras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Switch Perspective Cameras | |
$currentCamera = `lookThru -q`; | |
string $allCameras[]; | |
$allCameras = `listCameras -p`;// This will select perspective cameras only | |
int $nextCamera; | |
for($pos=0;$pos<size($allCameras);$pos++) | |
{ | |
if($currentCamera == $allCameras[$pos]) $nextCamera = $pos+1; | |
} | |
if($nextCamera>=size($allCameras)) $nextCamera = 0; | |
lookThru $allCameras[$nextCamera]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment