I need to create my own image buffer where I save alternate pixel data during MPxNode::compute().
I think the best would be to create the buffer in a callback for MSceneMessage::Message::kBeforeSoftwareFrameRender and then re-use that buffer in MPxNode::compute().
However, I can't figure out how to get the actual image resolution to create the buffer when the user has set a Test Resolution in the Render View's Options.
I tried the following
MCommonRenderSettingsData rsData; MRenderUtil::getCommonRenderSettings(rsData); unsigned int width = rsData.width; unsigned int height = rsData.height;
but this gives me the original resolution, before the Test Resolution modifier is applied.
I also tried looking at the rendering attributes xHighRenderRegion and yHighRenderRegion, but I get the same values as above.
I found that the values I need are available in MRenderData::resX and MRenderData::resY but I think I can only get MRenderData in MRenderCallback::renderCallback and MRenderCallback::postProcessCallback which are called after MPxNode::compute has finished, so it's too late for me.
Is there some other way I didn't find?
Thanks!
Solved! Go to Solution.
Solved by cheng_xi_li. Go to Solution.
Hi,
I think you can use optionVar -query renderViewTestResolution or MGlobal::optionVarIntValue to get the current renderViewTestResolution setting.
Yours,
Li