Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get actual render resolution before render

1 REPLY 1
SOLVED
Reply
Message 1 of 2
morinnicolas8944
528 Views, 1 Reply

Get actual render resolution before render

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!

1 REPLY 1
Message 2 of 2

Hi,

 

I think you can use optionVar -query renderViewTestResolution or MGlobal::optionVarIntValue to get the current renderViewTestResolution setting.

 

Yours,

Li

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report