Baker Node Add-on

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.

GitHub Repo

Documentation

11 Likes

This seems usefull, thanks for releasing this!

thank you for releasing this, seems really useful!

I think at the moment there isn’t a way to bake animation into image sequences? Are you planning to add such functionality?

Awesome work, this is brilliant!! Thanks so much for making this.

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.

Thanks for the comments everyone!

1 Like

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.

Thanks!

just want to say thanks, this helps me a lot!

How does this work under the hood. Is it just bpy.ops-es or does it use any external library? Seems so good I wonder how nobody had this idea.

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.

Does node have hidden image node hidden inside it, or did you find a way to bake without having to select image 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.

1 Like

Version 0.8 is now released!

Change log:

  • Added support for baking to image sequences (see the tips section of the documentation for details).
  • Added previews for the Image (UV) target type.
  • Added per-frame preview caching, allowing for previews in animated node trees to update in realtime.
  • Previews now check if they need updating when the frame changes.
  • Added various properties to the Additional Settings panel, including Margin Size and settings for target images.
  • Added Preview Samples property to preferences.
  • Fixed crash after reloading scripts.
  • Fixed issue with queuing non-background bakes whilst a background bake is in progress.
2 Likes

holy hell , thank you !

Version 0.8.1 change log

  • Bakers using the Image (Plane) bake type no longer require an object to be set or selected for baking.
  • Support baking from within the node trees of custom nodes (ShaderNodeCustomGroup instances).
  • Fixed ID class write errors when baking previews.
  • Improved error handling.
  • Display certain errors in node UI when preview bakes fail.
  • Typo fixes.
1 Like

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.
1 Like

Would it be possible to add support for baking tangent normal maps? (from a normal input)

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.

1 Like

Version 0.8.3

  • 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.
  • Typo fixes.
2 Likes