View Full Version : Is it possible to access the "render region" region using maxscript?

06 June 2008, 11:10 AM
You know when you select "crop" or "region" from the render dropdown, and you get that resizable render region in the viewport?

Well, I need to save and restore settings for different objects, but I'd much prefer to use the max UI rather than running everything through render().

Any ideas?


06 June 2008, 11:22 AM
Hi Dave,

Regions are stored per viewport and can be accessed using the viewport interface:

viewport.setRegionRect <viewport index> <box2>
Set the region rectangle for the specified viewport.

viewport.getRegionRect <viewport index>
Get the region rectangle for the specified viewport.

viewport.setBlowupRect <viewport index> <box2>
Set the blowup rectangle for the specified viewport. The blowup rectangle must have the same aspect as the current render output size aspect. The top, bottom, and left component values are taken from the Box2 value argument, but the right component value is re-calculated to force the proper aspect.

viewport.getBlowupRect <viewport index>
Get the blowup rectangle for the specified viewport.

06 June 2008, 11:24 AM
Awesome. Just found that myself!

Thanks Martin,

06 June 2008, 01:34 PM
Just in case anyone has done this before (in which case I'll not bother), I'm building a script that works out the minimum screen area needed to render an object, even animated ones.

The end result being a region that perfectly encloses the object so when you go to post with lots of objects, you don't need to render the entire frame (most of which is normally full of empty space) for each one, you can just render with the "crop" setting.

I'll probably work in some kind of save and restore per object, per camera.

Has this been done before?


CGTalk Moderation
06 June 2008, 01:34 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.