ScriptSpot home

Forum topic · General Scripting

Select camera from active vieport

By cuatcside · 2014-12-11

Description

Let's say your active viewport is a camera view,
I was wondering how you select that camera from active viewport by scripting.
Thanks for any help.

Comments (4)
crystal3d

this works though...

(
curcam = try(getActiveCamera()) catch()
if curcam != undefined do select curcam
)

miauu

.


(
	if viewport.getType() == #view_camera do
		activeCam = getActiveCamera()
)
Reply to miauu
crystal3d

this does not work:
(
if viewport.getType() == #view_camera do
activeCam = getActiveCamera()
)

i was lookng for something that works with corona...

Reply to crystal3d
miauu

.

I don't know what you expecting from the script but it works with Corona Cameras. Create several Corona cameras in your scene, set one of them as active, open maxscript listener and run the script. In the maxscript listener you will see the name of the active camera.