Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found a neat script called Camera Changer created by laky which toggles the viewport between cameras in the scene. I've binded this to a hotkey. It works great but stops when it has reached the last object/camera in the array.
Any ideas how to fix this?
-------------------------------------------------
--------------------------------------------------
-- Camera Changer 1.0 (Forward)
--
-- By laky (at) radiocityfx.com
--
-- Original idea: Sam O'Hare
--
-- 2004 Oct 22
----------------------------------------------------
global currCam
global newCam
global currCamNumber
macroScript CamChangerFwd category:"My_Macro_Category" tooltip:"Camera Changer>>"
(
camera_array = cameras as array
if camera_array[1] != undefined then
(
currView = viewport.getType()
if currView != #view_camera then newCam = camera_array[1] else
(
currCam = viewport.getCamera()
currCamNumber = findItem camera_array currCam
if currCamNumber < camera_array.count-1 then newCam = camera_array[currCamNumber+2] else
newCam = camera_array[1]
)
viewport.setCamera newCam
curcam = try(getActiveCamera()) catch()
if curcam != undefined do select curcam
)
else messagebox "No cameras in scene"
)
Solved! Go to Solution.