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: