Blender has the ability to limit the scope of rendering – outlining a region the special render border and checking the Border checkbox on the Render – Dimensions tab in Properties window. If such frame is set – Blender render only a limited area of the image.

There are two ways to set render border via the Blender API:
- With the view3d.render_border operator:
1 |
bpy.ops.view3d.render_border(xmin=188, xmax=423, ymin=271, ymax=489) |
This operator is used in the 3D VIEW context:
1 |
bpy.context.area.type = 'VIEW_3D' |
Border coordinates countdown starts from the top-left corner of all window (0,0) and ends in the lower-right corner with values correspond to the window size.

- With modifying scene properties – maximum and minimum border boundaries relatively to the rendering camera view:
1 2 3 4 |
bpy.context.scene.render.border_min_x = 0.3 bpy.context.scene.render.border_min_y = 0.2 bpy.context.scene.render.border_max_x = 0.9 bpy.context.scene.render.border_max_y = 0.8 |
In this case, the render border coordinates set as a percentage ratio to the resolution of the rendering scene (camera view). The render width and height are equal to one unit, and the render border coordinates are set as a proportion of it.

In both cases, to activate render border usage the Border checkbox turns on with:
1 |
bpy.context.scene.render.use_border = True |