3

I'd like to be able to define a Render Region and recall it, if possible. Is there a way to do this? As it is now, a drawn Render Region is only temporary, and only one can be drawn at a time.

You can see the drawn render region below, and as I work on the project, I render the animated faders again and again. I'd love it if I could get the render region consistent from time to time instead of having to redraw it.

enter image description here

  • Hello :). As an alternative - You could duplicate your camera, lower the sensor size and use lens Shift to move the view. – jachym michal Mar 16 '21 at 19:57
  • Nice idea, but I wanted to preserve the dimensions of the render as it is, so I'm not sure if this would work the way I need it to. If I do what you're suggesting, I'd have to diddle with the output dimensions. – Dan McKinney Mar 16 '21 at 20:20
  • 1
    I've seen this post, and while it's somewhat helpful, it's not quite what I'm looking for. I suppose what I'm looking for isn't possible, but the idea is to be able to save a render border as an object that can be named and recalled as necessary.

    I've got a bunch of animated objects in my project I need to export separately. I would like to assign render regions to each of the exported elements, so I end up with consistent output through my many revisions.

    As it is, the render border is something that's drawn and deleted - it's just such a temporary entity!

    – Dan McKinney Mar 16 '21 at 20:49
  • 2
    Hello again :). One another solution comes to mind - you could create your own render border using a plane with a "window" cutout and a holdout shader. The plane will render as a transparent area - which takes no time to render with adaptive sampling on. – jachym michal Mar 16 '21 at 23:02
  • 1
    That's a great idea, too! Will try it out! – Dan McKinney Mar 17 '21 at 10:51
  • 1
    That is definitely the best solution so far - works perfectly. Thanks!! – Dan McKinney Mar 17 '21 at 12:13

2 Answers2

1

You can make a script like this:

import bpy

max_saves = 4 # if you have that many saved regions, trying to create a new one will throw an error # remove old saves to create a new one

save_name = "restore_render_regions_{}.py"

out = "import bpy\n\n"

for name, scene in bpy.data.scenes.items(): out += f"scene = bpy.data.scenes.get('{name}')\n"
f"if scene:\n"
f" scene.render.border_min_x = {scene.render.border_min_x}\n"
f" scene.render.border_max_x = {scene.render.border_max_x}\n"
f" scene.render.border_min_y = {scene.render.border_min_y}\n"
f" scene.render.border_max_y = {scene.render.border_max_y}\n"
f"# --\n\n"

for i in range(max_saves): filename = save_name.format(i) if filename not in bpy.data.texts: break else: raise MemoryError("Number of saved render region states exceeded the limit - increase the limit or "
"remove old saves")

file = bpy.data.texts.new(filename) file.write(out)

Running it will create another script named restore_render_regions_{0}.py with saved region coordinates, so you can run the automatically generated script to restore the coordinates at any time (the Texts are saved with the file).

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99
0

I sometimes use in menu bar View > Viewport Render Image.

Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187
Golden 53
  • 1
  • 2