Select camera from active vieport

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
crystal3d's picture

this works though...

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

miauu's picture

.

(
	if viewport.getType() == #view_camera do
		activeCam = getActiveCamera()
)
crystal3d's picture

this does not work: ( if

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

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

miauu's picture

.

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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.