PDA

View Full Version : Possible to get specific viewport's width and height?


walfridson
11-08-2010, 02:54 PM
It's possible in python by using activeView = OpenMayaUI.M3dView.active3dView()

A: Is there a similar command in MEL?

B: Possible to specify which viewport to get this instead of the active one?

Thanks!

NateH
11-08-2010, 04:07 PM
A) Just get the size of the editor itself (Not the model panel)
cmds.control('someModelEditor', q=True, wh=True)

B) Use getM3dViewFromModelEditor
renderWindow = 'someModelEditor'

view = apiUI.M3dView()
apiUI.M3dView.getM3dViewFromModelEditor(renderWindow, view)

walfridson
11-09-2010, 08:22 AM
Thank you very much

For A, is it possible to query the active view?

NateH
11-09-2010, 10:14 AM
Yeah, you can get the panel with focus, and query the model editor from there. Also, looking at getpanel, it can get the panel under the cursor without using the api/pyqt. Although it won't get any other controls, only panels.

cmds.getPanel( withFocus=True)
cmds.getPanel(underPointer=True)

walfridson
11-10-2010, 02:16 PM
Awesome, thank you very much for your help!

CGTalk Moderation
11-10-2010, 02:16 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.