Baker Node adds a node to Blender’s shader editor that can quickly bake its input
to an image, color attribute or sculpt mask.
Uses
Quickly create stencil masks or brush masks/textures from shader nodes.
Use shader nodes to set or modify an object’s sculpt mask.
Improve shader performance by baking the results of complex node setups.
Use the outputs of various Cycles-only nodes in Eevee.
Easily export texture maps from any part of the shader.
Features
Can bake to an image, color attribute or the sculpt mask of the active object.
Supports baking in the background (Blender 3.3+).
Baker nodes can be synced so that multiple nodes can be baked with one click.
Option to automatically create target images or color attributes when baking.
Supports baking both color and alpha.
Target Types
Image (UV) - Bake to an image using a UV map of the active object.
Image (Plane) - Bake to an image using the co-ordinates of a plane. Useful for creating brush textures/masks. An automatically updating preview of the result can be displayed by expanding the Preview section on the node.
Color Attribute - Bake to a color attribute on the active object.
Sculpt Mask - Replace or modify the active object’s sculpt mask.
Usage
Location: Shader Editor > Add > Output > Baker
Connect the baker node’s input, set the target type and (optionally) select or create the image/color attribute to bake to. Then press the bake button on the node.
If no baking target is set then one can be created automatically (if enabled in the add-on settings).
The baker node’s Baked Color and Baked Alpha sockets output values from the target image or color attribute. They can be used to improving a shader’s performance by inserting the baker node after slow sections of the shader.
Settings such as the number of samples and the object to use when baking can be set in the node’s Settings menu accessed by clicking the gear icon on the right of the node.
Yes, currently baking to image sequences isn’t supported. It seems relatively straightforward though, so hopefully I’ll be able to add support fairly soon.
that’d be a great functionality! I often work on projection mapping projects, and the ability to bake image sequences would be a godsend for these kind of projects and probably many more situations.
Internally it uses bpy.ops.object.bake with Cycles as the renderer. It’s essentially baking with the emit bake type performed inside of a subclassed ShaderNodeCustomGroup node. Sculpt mask, image plane and preview baking require a few extra steps, but still perform the actual baking in the same way.
Incidentally, because the node uses Cycles for baking most of the settings in the Render Properties panel that normally affect baking (margin size, noise threshold etc) also affect bakes performed using the node.
It creates and selects an Image Texture node in the same node tree as the baker node when the bake operator is invoked (unfortunately placing it inside the node doesn’t work) and deletes it when Blender has actually started the bake (i.e. when bpy.app.is_job_running(‘OBJECT_BAKE’) == True). So the image node is only visible for a very short time (< 1s).
For bakes that aren’t run in the background (like preview bakes) the interface freezes and the image node is simply deleted when the bake finishes so that it’s never visible at all.
Version 0.8.2 makes the add-on compatible with Blender 4.0 as well including a few minor changes and bug fixes.
Due to the node tree API changes in Blender 4.0 previous versions of the add-on will only work in Blender 3. Version 0.8.2 will work with both Blender 3 and Blender 4.0.
(Blender 4.0) Fixed add-on not enabling due to attribute errors from API changes.
(Blender 4.0) Fixed errors due to changes to the node tree interface API.
(Blender 4.0) Fixed baker not appearing in the Add > Output node editor menu.
(Image (UV)) Display margins on previews if the baker has an image set.
Improved handling of alpha for previews.
Fixed bug in sRGB conversion on Blender 3.3 and less when not using NumPy.
Fixed errors due to node tree rebuilds potentially being triggered during draw calls.
Just added a method for doing so to the main branch! After opening a context menu with a Baker node active select Add Baker Set-up > Input to Tangent Space. This will add a group node between the Baker and its input that converts normals to tangent space.
It’s not in any release yet, but there I’ll likely add a new release in a few days time.
Added Save on Bake property to the Additional Settings panel. This will automatically save the target image after baking if the image is packed or has a filepath set.
Added Input to Tangent Space to the Add Baker Set-up section of the context menu. This can be used to bake tangent-space normal maps.
Use image-based baking for Image (Plane) previews. Enable Use VA Based Previews in the add-on preferences to restore the old behavior.
Fixed crashes when baking with Image (Plane).
Fixed crashes when duplicating a material containing a Baker in Blender 4.0
Suppress console messages about saving to an internal image when baking.