ScriptSpot

Forum topic · General Scripting

viewport.setType() for a xref scene camera

By zahid hasan · 2017-06-10

Description

Hello guys,

I cant find a way to set viewport to a specific camera which is in xref scene.
viewport.setType $cameraname not working. but when this camera is set as active then i can access it by getActiveCamera(). Do you know any workaround to make it active ?
Thanks for reading.

Comments (3)

zahid hasan · 2017-06-16

Thanks Pixamoon. i am very excited to get an answer after days.

`

pixamoon · 2017-06-15

Hi,

try this:


c = getNodeByName "cameraname"
-- or
c = $cameraname
viewport.setType c.actualBaseObject

Best,
Pixamoon

zahid hasan · 2017-06-16

I tried this but C=getNodeByName "cameraname" returns undefined. Maybe this will work if my camera is a xref object and not in a xref scene.