Specify Arnold render region size in Render Sequence?

2,533 views
Skip to first unread message

Nathan Shipley

unread,
Dec 5, 2017, 3:24:53 PM12/5/17
to maya...@googlegroups.com
I'm trying to render a large image in Maya 2018 / Arnold for print.  Target res is 11,400 x 26,100, but I could get away with half that:  5,700 x 13,050.  It's not rendering when I try to render with either of those dimensions, so I'm hoping to render tiles and combine them in Nuke.

My question:
Anyone know if it's possible to set a specific render region size when using Render Sequence with Arnold in Maya 2018?

A couple notes:
- I know it can be done in batch render using the -reg flag, as described in the docs here, but we only have the Arnold as-included in Maya and can't render batch without a watermark.  Is it possible to use -reg with Render Sequence?

- I also know that I can set a render region box in the Maya render view that Arnold will respect if I render with "Render Region" checked in the Render Sequence dialogue.  It's kind of clunky to set this way though since it takes float values (that seem to relate to the film back size?) instead of pixels.

This is how I set the the render view region via MEL, as described here:
string $editor = `renderWindowEditor -q -editorName`;
if( size($editor) == 0 ){
   $editor = `renderWindowEditor "renderView"`;
}

renderWindowEditor -e -mq 0.7 0.3 0.3 0.5 $editor;

I'd love if there was a way to just define my regions with pixels or in the Arnold settings.

Thanks for any ideas,
 - Nathan

Nathan Shipley

unread,
Dec 7, 2017, 12:55:56 PM12/7/17
to maya...@googlegroups.com
Some updates, in case anyone was curious.  I ended up figuring out a few things that have worked here:

- Wrote a simple MEL script to change the Render Region per frame and was able to tile my render that way.  I just added a little overlap to the float numbers set in renderWindowEditor and crop in Nuke.

- Also found out that if I enabled "Tiled" on the EXRs in the common render settings, my render doesn't crash and renders locally, albeit slowly because it's huge.  This writes the buckets to the EXR file as it renders instead of keeping all the AOVs in memory until the frame finished, which I assume is why my render would just stop and churn.

Hopefully helpful to someone!
 - Nathan

Tom Barnett

unread,
Jun 1, 2018, 11:51:55 AM6/1/18
to maya_he3d
Hi Nathan, 
This is indeed helpful for me as I am planning to render an image 7k x 10k using maya with arnold. I just wondered - is the mel script you refer to in your second message the same as the script you have included in your first?
I am going to have a crack at this early next week, just trying to be well prepared as my deadline is the end of the week. 

Thanks again,

Tom

Nathan Shipley

unread,
Jun 1, 2018, 4:31:42 PM6/1/18
to maya...@googlegroups.com
Hey Tom - 

The MEL script is different than what I mention in my first note, though its based on it.  Let me describe the setup for you here:

I made a locator called "CropControl" and added an expression to it then updates the render region in the Maya Render View depending on what frame we're on.  In my case, it was rendering 10 horizontal strips from top to bottom to make the final image.  There's a control that sets how many strips to create.  Here's frame 2 with the control set to 10 strips - note the red render region:



So then, then CropControl locator gets these two extra attributes.  Tile overlap makes the tiles just a touch bigger than we need them to be.  Vertical Tiles is the, surprise, the number of vertical tiles it will kick out:



The locator has this expression applied to it:

$cropAmount = 1 / CropControl.VerticalTiles;

$cropTop = (1 - ((frame - 1) * $cropAmount)) + CropControl.tileOverlap;

$cropLeft = 0;

$cropBottom = 1 - (frame * $cropAmount) - CropControl.tileOverlap;

$cropRight = .6;



string $editor = `renderWindowEditor -q -editorName`;

if( size($editor) == 0 ){

$editor = `renderWindowEditor "renderView"`;

}


// top, left, bottom, right

renderWindowEditor -e -mq $cropTop $cropLeft $cropBottom $cropRight $editor;


Note that I'm hard-coding the cropLeft and cropRight values here to something that worked for my portrait aspect ratio.  You may need to tweak these.

I render the sequence with "Render Region" enabled to EXRs:


Then I just take frames 1 to 10 and combine them in Nuke like this:



Hopefully this is helpful!

Let me know if you've got questions,
 - Nathan

--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nathan Shipley

unread,
Jun 1, 2018, 4:40:23 PM6/1/18
to maya...@googlegroups.com
Oh, and also, if you're curious - here's where that image ended up.  Was a thing I did for Adobe.  This is the horizontal web-resolution version of it:


 - N

Tom Barnett

unread,
Jun 4, 2018, 6:41:47 AM6/4/18
to maya_he3d
Hi Nathan,

Thanks so much for taking the time to compose this detailed explanation. And your final image looks great.
I have to confess I am relatively new to using expressions.

I got a bit stuck on how to add the expression to the 'CropControl' locator.
I worked it out though - so in case any future users are wondering:
Select CropControl then go to Modify>Add Attribute, create each attribute Nathan mentions: ie. Long name:  'tile Overlap', make sure it's Data Type is 'Float', and Attrribute Type is 'Scalar'. Then add, and move on to do the same for 'vertical Tiles'. Remember they're case sensitive. 
Then go to the extra attributes of CropControl and right click to add the expression.

So I have done a simple test render and it works. However there's something I wonder if you can advise me on some tweaking.
I did a 960x540 pixel frame size test with 10 tiles, and 0.002 tile overlap. 10 frame sequence.

I am wondering why $cropRight = .6; and not  $cropRight = 1; ? which for me gets a full width render region.

I got a render sequence where frame0001 is the whole image. Then frames0002-0004 are missing - nothing was rendered I guess, then frames0005-0010 have the actual render regions.
frame0005 is 63 pixels high. Frames 0006-0010 are 101 pixels high. So clearly the render region has been set somewhere to 96 pixels high before overlap added. So it's reading frame width rather than height. So where is the expression reading the frame dimensions and how do I make adjustments to rectify this? 
I am sure the answer is staring me in the face! But if you can point me in the right direction I would be really grateful.

Thanks again,


Tom




To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+...@googlegroups.com.

Tom Barnett

unread,
Jun 4, 2018, 7:04:35 AM6/4/18
to maya_he3d
OK so I tweaked the expression to replace a few numbers. I know you mentioned aspect ratio. I referred to this to get the right measurements. My aspect ratio is 1.77777. Therefore I need to use the reciprocal of this in $cropAmount, in $cropTop and in $cropBottom as follows:

$cropAmount = 0.5625 / CropControl.VerticalTiles;

$cropTop = (0.5625 - ((frame - 1) * $cropAmount)) + CropControl.TileOverlap;

$cropLeft = 0;

$cropBottom = 0.5625 - (frame * $cropAmount) - CropControl.TileOverlap;

$cropRight = 1;



string $editor = `renderWindowEditor -q -editorName`;

if( size($editor) == 0 ){

$editor = `renderWindowEditor "renderView"`;

}


// top, left, bottom, right

renderWindowEditor -e -mq $cropTop $cropLeft $cropBottom $cropRight $editor;


This worked so I am now ready to go! Thanks again for all your help Nathan! 

All the best,

Tom

Nathan Shipley

unread,
Jun 4, 2018, 7:06:48 PM6/4/18
to maya...@googlegroups.com
Nice!

Yeah I'm not totally sure how that crop setting works so it was a bit of trial and error to get where I did.  Glad you go it going for your scene!  Would be nice if there was a way to do it just in the render settings, but hey - here we are.  

Glad that was helpful,
 - N

--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages