View Full Version : Animated Limited Region - error on F10 render

11-15-2015, 07:45 AM
I'm writing an LScript to have my own implementation of an Animated Limited Region.

Layout will crash during F10-render, after it rendered 1 frame successfully, if the first rendered frame size is smaller than the size of the second frame.
If I start with a full frame, then there is no problem.

Note that with "start" I also mean that the current frame should be equal to the first frame of the sequence.
So imagine a shrinking RenderRegion (should be okay), but pressing the F10 render button while the current frame is at a position that has a smaller RenderRegion (via the Envelopes in my script), then it enters rendering phase also with a smaller RenderRegion.

Seems logical and fair to me since F10-render is not expecting any modification of the RenderRegion during the render phase.
As a workaround I could scan for the largest frame size before rendering and adjust the render sequence to that.

I wonder if more script writers have encountered this issue and how they solved this.

11-15-2015, 08:39 AM
Because renderer allocates frame buffer once, then reuse in further frames.
The same issue is with Camera Selector, if resolutions of cameras differ it will result in inevitable crash..

You're setting limited region in Layout Master evaluate() I presume? So it wouldn't work on renderfarm either..

11-15-2015, 09:24 AM
I'm using function process: event, command
and check Scene().renderopts[8]
if RenderRegion is active before using RegionPosition() to modify the RenderRegion.

Is there a way that makes it SN compliant?

11-15-2015, 10:12 AM
Limited Region has two modes: one renders a black border the size of the frame, one crops. Does the buffer allocation include the black border region?

11-15-2015, 10:42 AM
Yes, it's crashing in both cases.

If the Envelope is increasing the RenderRegion from frame 0 to frame 50, and the Current Time is set to frame 50 (RenderRegion is now full frame size), there is no problem.

If the Envelope is decreasing the RenderRegion from frame 0 to frame 50, and the Current Time is set to frame 50, I pre-process my scene before pressing F10 and GoToFrame(0) before starting the F10 Renderer.
It seems that it's not about the first rendered frame, it's about the RenderRegion size at the current frame when F10 is pressed.

In this case I handle a F10 keystroke in my plugin so pre-processing is easy.
I could search for the biggest RenderRegion in the renderrange and make that frame the Current Frame before sending the F10 command to Layout.

Also tried a pre-process that sets the RenderRegion to a full frame size before actually sending the F10 keystroke to Layout, but unfortunately that does not solve the issue.
This might be because I also modify the RenderRegion in the process() function.

[edit:] I was able to turn off AutoFrameAdvance in process() during F10 rendering, for instance when a larger RenderRegion is detected. This prevents Layout to crash.

11-15-2015, 11:11 AM
This is the same as this
has been said, it won't be fixed.

11-15-2015, 12:15 PM
The difference seems that in my case there is a workaround as I mentioned: changing the current frame to the frame that has the largest RenderRegion before starting the F10-rendering.

11-21-2015, 08:41 AM
A practical solution that solves the F10 rendering problem (crash) with an animated RenderRegion:

process: event, command
if(sceneObj.renderopts[8]) {
if(event==1 && command=="RenderScene (null)") {

RegionPosition(0,0,sceneObj.framewidth,sceneObj.fr ameheight);
} else RegionPosition( limitedRegionLeft, limitedRegionTop, limitedRegionWidth, limitedRegionHeight );