1 # SPDX-FileCopyrightText: 2019-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
8 Always wondered how big the render was going to be when rendering at a
10 This feature displays a "Final Resolution" label with the size in pixels
11 of your render, it also displays the size for border renders.
13 On the 'Dimensions' panel, Render properties.
18 def render_final_resolution_ui(self
, context
):
20 rd
= context
.scene
.render
21 final_res_x
= (rd
.resolution_x
* rd
.resolution_percentage
) / 100
22 final_res_y
= (rd
.resolution_y
* rd
.resolution_percentage
) / 100
23 final_res_x_border
= round(
24 (final_res_x
* (rd
.border_max_x
- rd
.border_min_x
)))
25 final_res_y_border
= round(
26 (final_res_y
* (rd
.border_max_y
- rd
.border_min_y
)))
29 layout
.use_property_split
= True
30 layout
.use_property_decorate
= False
34 col
= box
.column(align
=True)
36 split
= col
.split(factor
=0.4)
38 col
= split
.column(align
=True)
40 row
.alignment
= 'RIGHT'
41 row
.label(text
="Render Resolution")
45 row
.alignment
= 'RIGHT'
46 row
.label(text
="Region")
48 col
= split
.column(align
=True)
49 col
.label(text
="{} x {}".format(
50 str(final_res_x
)[:-2], str(final_res_y
)[:-2]))
53 col
.label(text
="{} x {}".format(
54 str(final_res_x_border
), str(final_res_y_border
)))
58 bpy
.types
.RENDER_PT_format
.append(render_final_resolution_ui
)
62 bpy
.types
.RENDER_PT_format
.remove(render_final_resolution_ui
)