import bpy, os, time
scene=bpy.context.scene
# Render a small Cycles validation of the actual final engine and materials.
old=(scene.render.engine,scene.render.resolution_x,scene.render.resolution_y,scene.render.resolution_percentage,scene.cycles.samples,scene.render.filepath)
scene.render.engine='CYCLES'
scene.render.resolution_x=384; scene.render.resolution_y=384; scene.render.resolution_percentage=100
scene.cycles.samples=16
scene.render.use_compositing=False
scene.render.filepath='<repo>/apps/console/camping_lantern_cycles_test.png'
t=time.time()
bpy.ops.render.render(write_still=True)
elapsed=time.time()-t
# Restore final benchmark 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')
result={'elapsed':round(elapsed,2),'exists':os.path.exists('<repo>/apps/console/camping_lantern_cycles_test.png'),'final_engine':scene.render.engine,'final_size':(scene.render.resolution_x,scene.render.resolution_y),'file':bpy.data.filepath}