Hi there,
I'm trying to capture the viewport at a size larger than the viewport window. In other words, if the Maya viewport window is 800 x 600 in size (let's assume this is the max size it can be) and I want to capture it at a size of 1600 x 1200 - how can I do this?
Here is my attempt (aplogies for not putting in code having trouble with formatting):
//get the camera from the active 3d view
MDagPath dagPath;
m_3dView = M3dView::active3dView(&status);
...
status = m_3dView.getCamera(dagPath);
...
MFnCamera cameraFn(dagPath,&status);
[b]...
//create a new 3d view that uses the active view camera[/b]
[b]m_3dView = M3dView();m_3dView.setCamera(cameraFn.dagPath());[/b]
[b]m_3dView.pushViewport(0,0,m_width,m_height);
[/b]
[b]//temporarily set camera overscan options[/b]
[b]double overscan_old = cameraFn.overscan(&status);[/b]
[b]...[/b]
[b]status = cameraFn.setOverscan(1.0);[/b]
[b]... [/b]
[b]status = m_3dView.refresh();[/b]
[b]... [/b]
[b]status = m_3dView.readColorBuffer(m_image,true);[/b]
[b]...[/b]
I tried using the active 3d view and pushing a new viewport size, when that didn't give the desired result I tried creating a new 3d view with the active 3d view's camera (this is the version I posted above).
The color buffer reads eveyrthing that is rendered in the viewport but only in the region in the active 3d view in Maya - but not in the extended region (this renders black)...
Hope someone can help!
Thanks 