---------------------------------------------------------------------------------- --Camera Switcher Script. --(C) Sam O'Hare, Pixelpollen.com, May 2004 --Last edited 31 Jan 2006 --Email sam@pixelpollen.com --Version 0.3 --Current Functionality --Cycle through all cameras in scene on keypress --0.1 Works with BCams --0.2 No longer affects the undo stack --0.3 Doesn't get stuck on targets in some scenes. --Proposed Functionality: -- ---------------------------------------------------------------------------------- --Variables-- global currentCamera global current_camera_number macroScript Cam_Switcher category:"Dusk" tooltip:"Camera Switcher Foreward" icon:#("Cameras",3) ( undo off ( --Get all cameras in scene camera_array = cameras as array camera_array_notarg = for i in camera_array where classof i != targetObject collect i cs = getcurrentselection() currentview = viewport.getType() if camera_array_notarg[1] != undefined then ( if superclassof cs[1] == Camera and viewport.getCamera() != cs[1] then newCamera = cs[1] else if currentview == #view_camera and viewport.getCamera() == cs[1] then newCamera = cs[1] else ( if currentview == #view_camera then ( currentCamera = viewport.getCamera() current_camera_number = findItem camera_array_notarg currentCamera if (camera_array_notarg.count - current_camera_number != 0)then newCamera = camera_array_notarg[current_camera_number+1] else if (camera_array_notarg.count - current_camera_number == 0)then newCamera = camera_array_notarg[1] ) else ( newCamera = camera_array_notarg[1]) ) viewport.setCamera newCamera ) ) ) macroScript Cam_Switcher_back category:"Dusk" tooltip:"Camera Switcher Back" icon:#("Cameras",3) ( undo off ( --Get all cameras in scene camera_array = cameras as array camera_array_notarg = for i in camera_array where classof i != targetObject collect i cs = getcurrentselection() currentview = viewport.getType() if camera_array_notarg[1] != undefined then ( if superclassof cs[1] == Camera and viewport.getCamera() != cs[1] then newCamera = cs[1] else if currentview == #view_camera and viewport.getCamera() == cs[1] then newCamera = cs[1] else ( if currentview == #view_camera then ( currentCamera = viewport.getCamera() current_camera_number = findItem camera_array_notarg currentCamera if (current_camera_number == 1) then (newCamera = camera_array_notarg[camera_array_notarg.count]) else newCamera = camera_array_notarg[current_camera_number-1] ) else ( newCamera = camera_array_notarg[camera_array_notarg.count]) ) viewport.setCamera newCamera ) ) )