Notifications
Clear all

[Closed] Is it possible to access the "render region" region using maxscript?

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?

Thanks,
Dave

3 Replies

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.

Cheers,
Martijn

Awesome. Just found that myself!

Thanks Martin,
Dave

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?

Cheers,
Dave