mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Add a warning in case user set a large drawing resolution #6686
Example - https://files.catbox.moe/0ygukk.png
This commit is contained in:
@@ -91,6 +91,24 @@ class BIM_PT_camera(Panel):
|
|||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(props, "height")
|
row.prop(props, "height")
|
||||||
|
|
||||||
|
render = context.scene.render
|
||||||
|
MEGAPIXELS_WARNING_THRESHOLD = 50
|
||||||
|
# See #6686.
|
||||||
|
if (
|
||||||
|
props.has_underlay
|
||||||
|
and str(render.engine) == "BLENDER_EEVEE_NEXT"
|
||||||
|
and ((megapixels := (render.resolution_x * render.resolution_y / 10**6)) > MEGAPIXELS_WARNING_THRESHOLD)
|
||||||
|
):
|
||||||
|
box = self.layout.box()
|
||||||
|
box.label(
|
||||||
|
text=f"Resulting image size is {render.resolution_x} x {render.resolution_y} ({round(megapixels, 2)} MP).",
|
||||||
|
icon="WARNING_LARGE",
|
||||||
|
)
|
||||||
|
box.label(
|
||||||
|
text=(f"Which is more than {MEGAPIXELS_WARNING_THRESHOLD} megapixels and will require a lot of VRAM.")
|
||||||
|
)
|
||||||
|
box.label(text="Underlay render might crash if VRAM requirement is not met.")
|
||||||
|
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(camera_data, "clip_end", text="Depth")
|
row.prop(camera_data, "clip_end", text="Depth")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user