Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Resolution Gate Corners...

Resolution Gate Corners...

Anonymous
Not applicable
391 Views
0 Replies
Message 1 of 1

Resolution Gate Corners...

Anonymous
Not applicable
Hello!

I'm trying to find the viewport resolution gate corners coordinates
using python API in Maya 2008.

Running the following procedure I am able to find
viewport corners coordinates, but not for resolution gate.

It should work for all filmFit options:
Fill, Horizontal, Vertical and Overscan.

Could anyone help me please?

Thank you in advance!

mascio

...

my lines:

import sys
import maya.OpenMaya as OpenMaya
import maya.OpenMayaRender as OpenMayaRender
import maya.OpenMayaUI as OpenMayaUI
import maya.cmds as cmd

def viewPortCoords():

glRenderer = OpenMayaRender.MHardwareRenderer.theRenderer()
glFT = glRenderer.glFunctionTable()

activeView = OpenMayaUI.M3dView.active3dView()
MFnCam = OpenMaya.MFnCamera()

xPtrInit = OpenMaya.MScriptUtil()
yPtrInit = OpenMaya.MScriptUtil()
widthPtrInit = OpenMaya.MScriptUtil()
heightPtrInit = OpenMaya.MScriptUtil()

xPtr = xPtrInit.asUintPtr()
yPtr = yPtrInit.asUintPtr()
widthPtr = widthPtrInit.asUintPtr()
heightPtr = heightPtrInit.asUintPtr()

activeView.viewport(xPtr, yPtr, widthPtr, heightPtr)
viewX = xPtrInit.getUint( xPtr )
viewY = yPtrInit.getUint( yPtr )
viewWidth = widthPtrInit.getUint( widthPtr )
viewHeight = heightPtrInit.getUint( heightPtr )

camera = OpenMaya.MDagPath()
OpenMayaUI.M3dView.active3dView().getCamera(camera )
fnCamera = OpenMaya.MFnCamera(camera)
cameraName = (fnCamera.fullPathName()).split('|')

bottomLeft = 0,0
topLeft = 0,viewHeight
topRight = viewWidth,viewHeight
bottomRight = viewWidth,0

return bottomLeft,topLeft,topRight,bottomRight
0 Likes
392 Views
0 Replies
Replies (0)