From 73e82b1cad390917851ef312ea65d71b90111d0f Mon Sep 17 00:00:00 2001 From: ChristopheSeux Date: Thu, 28 Sep 2023 16:11:48 +0200 Subject: [PATCH] Missing prop resolution --- operators/manage_objects.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/operators/manage_objects.py b/operators/manage_objects.py index 2807f33..e2eb28d 100644 --- a/operators/manage_objects.py +++ b/operators/manage_objects.py @@ -10,6 +10,8 @@ from .. import core def set_resolution_from_cam_prop(cam=None): + rd = bpy.context.scene.render + if not cam: cam = bpy.context.scene.camera if not cam: @@ -17,9 +19,9 @@ def set_resolution_from_cam_prop(cam=None): res = cam.get('resolution') if not res: - return ('ERROR', 'Cam has no resolution attribute') + cam['resolution'] = [rd.resolution_x, rd.resolution_y] + return ('INFO', 'Cam resolution set from scene') - rd = bpy.context.scene.render if rd.resolution_x == res[0] and rd.resolution_y == res[1]: return ('INFO', f'Resolution already at {res[0]}x{res[1]}') else: