# 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?

• Not so sure what you're asking, so the steps to create a bake is simply unwrapping your object, creating a new file image by pressing the new button in the render window, and then baking as you wish, so what differently are you trying to do here? – Luka ash May 15 '16 at 14:53
• @Luka ash -- this is how baking works for Blender internal, did you make it to work for Cycles as well? – dimus Jun 30 '16 at 18:01

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

If by "file" you mean "image texture" the solution is quite easy. Just add a texture node to your node setup that is not connected anywhere. Then go to UV image editor, create a new image and use this in the texture node you created before - like in my setup below (the active image in the red square).

• That's 'normal way', and the error message implies there is other day of doing this – dimus May 15 '16 at 19:15
• Actually the correct answer... I don't understand how a python script can be the accepted answer. OP asked for saving in external file. In General, Docs say "The baking happens into the respective active textures of the object materials. The active texture is the last selected Image Texture node of the material node tree" Source - you can unpack that into an external file easily. – KYL3R Jul 10 '18 at 8:39