ScriptSpot

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)

this works though...

crystal3d · 2020-02-23

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

.

miauu · 2014-12-11


(
	if viewport.getType() == #view_camera do
		activeCam = getActiveCamera()
)

crystal3d · 2020-02-22

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

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

.

miauu · 2020-02-23

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.