import bpy
from mathutils import Vector
scene=bpy.context.scene
# Improve the product-shot read: move camera slightly closer and lower, and brighten only the controlled studio fill.
cam=bpy.data.objects.get('Hero camera')
cam.location=(5.65,-8.55,4.35)
cam.data.lens=62
cam.rotation_euler=(Vector((0,0,2.03))-cam.location).to_track_quat('-Z','Y').to_euler()
cam.data.dof.focus_distance=(Vector(cam.location)-Vector((0,0,1.92))).length
cam.data.dof.aperture_fstop=7.1
# Add a broad, low-energy frontal softbox to recover dark metal detail while preserving contrast.
ld=bpy.data.lights.get('Product front softboxData') or bpy.data.lights.new('Product front softboxData','AREA')
ld.energy=430; ld.shape='DISK'; ld.size=4.0; ld.color=(0.28,0.34,0.46)
ob=bpy.data.objects.get('Product front softbox') or bpy.data.objects.new('Product front softbox',ld)
if not ob.users_collection: bpy.data.collections['Lighting'].objects.link(ob)
ob.location=(2.4,-5.8,3.1)
ob.rotation_euler=(Vector((0,0,1.8))-ob.location).to_track_quat('-Z','Y').to_euler()
# Keep final native settings.
scene.render.engine='CYCLES'; scene.render.resolution_x=1536; scene.render.resolution_y=1536; scene.render.resolution_percentage=100; scene.cycles.samples=64; scene.render.filepath='<repo>/apps/console/camping_lantern_final.png'; scene.render.use_compositing=False
bpy.ops.wm.save_as_mainfile(filepath='<repo>/apps/console/camping_lantern.blend')
# quick 480px Eevee check
scene.render.engine='BLENDER_EEVEE'; scene.render.resolution_x=480; scene.render.resolution_y=480; scene.render.filepath='<repo>/apps/console/camping_lantern_preview2.png'; scene.render.use_compositing=False
bpy.ops.render.render(write_still=True)
# restore
scene.render.engine='CYCLES'; scene.render.resolution_x=1536; scene.render.resolution_y=1536; scene.render.resolution_percentage=100; scene.cycles.samples=64; scene.render.filepath='<repo>/apps/console/camping_lantern_final.png'
bpy.ops.wm.save_as_mainfile(filepath='<repo>/apps/console/camping_lantern.blend')
result={'cam':tuple(round(v,2) for v in cam.location),'saved':bpy.data.filepath,'preview':'camping_lantern_preview2.png'}


Info: Saved as "camping_lantern.blend"
Info: Saved as "camping_lantern.blend"