How to bake in Cycles to an external file When I try to bake in Cycles without creating a material with an active image first, I get an error message (Blender 2.77)


  No active image found, add a material or bake to an external file


So from the error message I assume that except commonly known way of adding an active image to the object material, it is possible to bake to external file directly, if material is not really needed.

I would like to know how to bake to an external file in Cycles without creating a material with active image?
I am using 2.77 and still don't see that option to bake to an external file,anyway i found this and it's probably what you want  

bpy.context.scene.render.bake.filepath = "/tmp/baked.png"
bpy.context.scene.render.bake.save_mode = 'EXTERNAL'
bpy.context.scene.render.bake.use_split_materials = True # or False

or
bpy.ops.object.bake(filepath="/tmp/baked.png", save_mode='EXTERNAL', use_split_materials=True, ...)

source : blender repo