ScriptSpot

Forum topic · General Scripting

How to get viewport size?

By BPL · 2017-05-16

Description

Hello everyone,

I've been trying to find a way to get the viewports sizes already for a while (width/height) and no luck so far.

I've tried getRegionRect but that one doesn't change when i resize the viewport. Also, in this link https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/20… is suggested to use renderWidth & renderHeight as a way to calculate the camera's aspect ratio...

Anyway, how could i get a viewport size?

Thanks in advance.

Comments (2)

.

miauu · 2017-05-17


getViewSize()

Returns the active view size as point2 in pixels.

BPL · 2017-05-17

Awesome! thank you very much, i've been looking for this one already for quite a while ;D