Forum: Poser - OFFICIAL


Subject: New Reality (lux render) Plugin over at Daz...time for Poser Plugin Update?

Ridley5 opened this issue on Jul 26, 2010 ยท 1724 posts


Dizzi posted Fri, 27 August 2010 at 4:56 AM

This code will return the current viewport size in Poser 8/Pro if render dimensions are set to "match preview window". Otherwise the output resolution set.

import poser
if poser.Version()=='8.0':
        import wx.aui
def GetOpenGLCanvas():
        l=[]
        for child in poser.WxAuiManager().GetManagedWindow().Children:
                GetOpenGLCanvasRec(child, l)
        return l
def     GetOpenGLCanvasRec(win, l):
        for child in win.Children:
                if child.Name in ['PoserPBCanvas']:
                        l.append(child)
                else:
                        GetOpenGLCanvasRec(child, l)
def GetOutputRes():
        s=poser.Scene()
        if poser.Version()=='8.0' and s.RenderDimAutoscale()==2:
                return GetOpenGLCanvas()[-1].GetSize()
        else:
                return s.OutputRes()

print GetOutputRes()