Thanks for the reply, Petrov.
I found couple limitations of the script you posted in the mentioned thread.
1. You need to have the Maya Render View open to execute the script. Otherwise, maya crashes (tested in Maya 2014 and 2015 on Windows 7 x64).
2. the resolution is dependent on the window size of Maya Render View. I tend to leave Maya Render View as a very thin bar for accessing the buttons only. With that, the screen capture I got will be extremely low rez in Vray Frame Buffer.
Hope when it’s implemented in VFB, it is a independent thing without relying on an open Maya Render View to properly execute some functions.
// generate the snapshot in RenderView
renderWindowRenderCamera snapshot renderView "";
// save the image to file
string $renderPanels[] = `getPanel -scriptType "renderWindowPanel"`;
string $filename="/tmp/vray.snapshot.jpg";
python("import maya.app.general.createImageFormats as createImageFormats");
python("formatManager = createImageFormats.ImageFormats()");
python("formatManager.pushRenderGlobalsForDesc(\"JPEG\")");
renderWindowEditor -e -writeImage $filename $renderPanels;
python("formatManager.popRenderGlobals()");
// open the image in the VFB and delete the file
vray vfbControl -loadimage $filename;
sysFile -delete $filename;
Hm, these limitations could make the real implementation impossible, because we’ll have to ask Maya to render the image for us.
But I’ve not investigated it further.
Are these moving up on the to-do list? Still waiting for these features so I can forget about Maya’s Render View.
Also, I notice that oftentimes when I stop IPR from VFB, the IPR is stopped with Maya’s Render View red square button turned off, but the round “stop” button in VFB is still on (although the IPR has been stopped). Seems a small glitch, but I would like the day when I don’t open Maya’s Render View, the “Stop” button in VFB correctly indicate the status of IPR running or not.
Unfortunately, I’m not sure we’ll able to fix this problem.
It is a known problem and we’ve tried to fix it, but there are lots of complications related to this small button.
It reflects the status of ADV render correctly “almost” every time but somehow not IPR. Guess I can always have Maya’s Render View open to check the status of IPR.
Anyhow, the snap shot button, IPR button (with right-click to select render camera), and resolution percentage is of higher interests than the above.