Principled Baker - Bake PBR textures with a few clicks


Principled Baker for Blender 2.79 here: https://github.com/danielenger/Principled-Baker_for_2-79


Bake PBR textures with a few clicks

Features:

  • Autodetection of what needs to be baked by connected inputs
  • Manual selection for texture channels
  • bake almost all Principled BSDF (and more) inputs (Color, Metallic, Roughness, etc.) to image textures
  • Autodetection/Manual selection also for Alpha, Emission, Ambient Occlusion (from node; 2.80 only), Diffuse, Glossiness (invert Roughness), Bump (as hightmap), Vertex Color, Material ID
  • 3 Bake Modes:
    • Combined (new default): Bake a single selected object or bake multiple selected objects with shared UV maps. This is like Blenders default bake.
    • Single/Batch (previous default): Bake every selected object separately.
    • Selected to Active: Does what it says.
  • Create new material with new image texture nodes (most image nodes connected)
  • Auto Smooth from object/on/off
  • Auto UV unwrap option: Smart UV Project/Lightmap Pack

Limitations/Warnings:

  • Be careful with Overwrite! It does what it says!

  • Baking works in Cycles only. (for now; see Baking “in” Eevee)

  • Displacement works only with a Displacement node. (Blender 2.80)
    Vector Displacement does not work.

  • Color inputs of transparent nodes (Transparent, Translucent, Glass) will be ignored by default.
    This prevents false colors at transitions from being baked into the Color Texture.
    Deactivate “Exclude Transparent Colors” to bake transparent inputs to Color Texture.

  • Autodetection:
    If just a Bump node is in the node tree, the Normal Map will always be baked.
    If a Normal Map and a Bump Map is baked, the Bump node will not be linked in newly created material.

  • Some results from complex mixed shader node trees might not be useful

  • no bake from Ambient Occlusion Shader in 2.79

  • Auto UV unwrap not available in Blender 2.79 for multiple objects (bake mode: Combined)

  • with Material Name to define the Material ID Colors: Duplicate colors are possible!

  • Baking “in” Eevee did crash Blender 2.80 beta sometimes! I had no crashes with the recent builds while testing.

  • known issues:
    – results for Subsurface Radius is not useful
    – results for Tangent might not be useful
    – batch baking with shared materials can give useless, half baked image textures
    – typo in github name (can not be solved?)


update 0.3.3

  • UI change: Bake List below bake button and bake mode to make scrolling less annoying
  • Ambient Occlusion removed from Bake List in Blender 2.79 (AO not supported in 2.79)
  • Bump (Height) removed from Bake List (is in Additional Bake Types)
  • fixed: 16/32 bit float images wrong colors (from view transform)
  • fixed: missing compression for PNG
  • fixed: codec for OPEN_EXR, codec for TIFF, quality for JPG not working
  • fixed: Selected to Active UV Map check for selected objects
  • fixed: save in wrong path with relative path in Blender 2.79
  • fixed: missing check for selected Diffuse passes
  • fixed: missing suffixes

update 0.3.2

  • Bake List for manual selection of Bake Types
  • detection of Bake Types for Bake List from selected objects
  • presets for Bake List
  • removed BW from color mode
  • UI changes
  • fixed: missing custom suffixes (are part of Bake List)

update 0.3.1

  • Select UV Map to bake on
  • minor UI changes

update 0.3.0

  • fixed: diffuse image colorspace not in sRGB

update 0.2.9

  • fixed: non-mesh objects in selected objects causing problems

update 0.2.8

  • update to changes in Image nodes and Principled BSDF nodes in Blender 2.80

update 0.2.7

  • bake diffuse direct/indirect (only for Combined and Single/Batch, does not work properly for Selected to Active)
  • influence settings for normals working (see Render (tab) > Bake > Bake Type = Normal > Influence)

update 0.2.6

  • fixed: ‘image’ referenced before assignment without Create New Material

update 0.2.5:

  • baking in Eevee/Workbench by temporarily switching to Cycles - This may crash Blender 2.80 beta!
  • Create New Material/Add New Material as two separate options
  • Mapping and Texture Coordinate nodes for new material
  • fixed: results in Combined mode partially black
  • fixed: Vertex Color baking only with material
  • fixed: empty material slot removal
  • fixed: color outputs in factor inputs not BW
  • fixed: wrong material ID colors with shared materials (by slot/hue)

update 0.2.4:

  • 3 bake modes: Combined, Single/Batch, Selected to Active
  • Material ID (two methods to define Material ID Colors; see Addon Preferences)
  • Auto Lightmap Pack option
  • fixed: Selected to Active samples not working
  • fixed: shared material color always white
  • fixed: Selected to Active prefix

update 0.2.3:

  • Auto Smooth
  • Vertex Color
  • AO mix in new material
  • fixed: MixRGB missing link test

update 0.2.2:

  • fixed: wrong colors from Mix RGB nodes + AO

update 0.2.1:

  • fixed: selected to active missing image file check
  • fixed: selected to active wrong texture names
  • fixed: empty material slots errors

update 0.2.0:

  • 16/32 bit support
  • image settings
  • samples setting
  • Glossiness (invert Roughness) option
  • progress feedback (cursor)
  • Ambient Occlusion from node (for testing)
  • backport to Blender 2.79
  • bugfixes

update 0.1.9:
fixed: mix with emission
fixed: normal map black

update 0.1.8:
new: Auto Smart UV Project
bugfix: no UV map as potential input error

update 0.1.7:
bugfix: margin not applied

update 0.1.6:
bugfix: file paths
other bugfixes

update 0.1.5:
autodetection: support for more shader nodes
new UI
bugfixes

update 0.1.4:
fixed: missing bake button

update 0.1.3:
port to blender 2.8

update 0.1.2:
new: alpha channel to color (optional)
fixed: alpha channel color space

update 0.1.1:
fixed: alpha color space not sRGB

update 0.1.0:
new: batch baking
new: selected to active baking
new: better auto detection
new: support for multiply materials
new: copy values of Principled BSDF nodes to Principled BSDF node in (optional) new material
new: optional alpha channel (know issue: previously created images without alpha channel need to be deleted by hand to get alpha channel)
fixed: linear color space for values

update 0.0.6:
fixed: wrong baked colors from non-color data image nodes

update 0.0.5:
new: optional bake bump maps to normal maps

update 0.0.4:
new: optional new Material

25 Likes

I think I shall make use of this.

Interesting, thank you for this!

Usefull thing. Thanks

I would love to see this in eevee after 2.8 is stable.

This is fantastic. Nice job, thanks for sharing Daniel!
If we had an option for the rendered textures to autoimport into the scene and replace the existing nodeinputs (those replaced once wouldn´t have to be deleted, just disconnected and kept in case you want to tweak their values again), we would pretty much have the basics of a true substance painter like workflow inside of Blender, only potentially more powerful because of all the possibilities of rgb-maths and vector-maths. We´re getting close people :eyebrowlift:

Thanks DanielEngler, a really nice idea!
Congrats. :yes:

Hello, look like very neat.
I receive an error on install:


Os X, Blender 2.79/2.79a

Thank you!
Darn it! I somehow deleted “category” from bl_info.

Important! Download the update 0.0.2!

Yes! Me, too! Officially build in the first place and not just as an addon with hacky code. :slight_smile:

Good idea. I’ll keep that in mind for the next update. Let me think: Maybe with an other Principled BSDF node in the material with all the baked textures connected to not to destroy anything. than I need to tag the source principled BSDF node and the new one and store the tags. maybe with custom properties. Anyway, I’ll find a solution. :slight_smile:

1 Like

new in update 0.0.3:
Optional new Principled BSDF node for manual preview.

There is a known bug: Overwrite with an other resolution does not work. The workaround is to remove the image nodes and all users from the textures and restart/revert.

update 0.0.4:
new: optional new Material

removed: optional new Principled BSDF node for manual preview

fixed: overwrite with new resolution bug

update 0.0.5:
new: optional bake bump maps to normal maps

I like this, would be nice to see some practical screenshots / examples. Seen a similar paid script recently as well. This will be very useful when EEVEE is used more frequent by users.
You might almost want the reverse path as well, create or update a BSDF material based on images in a folder. That way you could push back and forth textures between different tools or apps. Might look into this idea myself as well in the future.

Thanks for sharing!!!

2 Likes

Maybe I should make a tutorial with a simplified example, so people can quicker understand, what the add-on does and what it’s good for and what not, and how to use it.

What’s the name of that script?

So, basically the functionalities “Add Principled Setup” and “Reload Images” from Node Wrangler, but with a single click on a button based on the name of the used texture.
Well, I think this would be more suitable for an other add-on, because I think this would be out of the functionality of Principled Baker. But I’ll put this on the maybe feature list. :slight_smile:

Thanks for your feedback! Now, I have to make a tutorial. :stuck_out_tongue:

Bakery-Bake-Cycles-Materials-to-PBR-Textures
It seems to focus on Any Cycles materials with a custom node wrapper- but I assume that it is the same idea.

Yes, same idea - different approaches.

update 0.0.6:
fixed: wrong baked colors from non-color data image nodes

update 0.1.0:
new: batch baking
new: selected to active baking
new: better auto detection
new: support for multiply materials
new: copy values of Principled BSDF nodes to Principled BSDF node in (optional) new material
new: optional alpha channel (know issue: previously created images without alpha channel need to be deleted by hand to get alpha channel)

fixed: linear color space for values


Well, I hope everything works fine now.

update 0.1.2:
new: alpha channel to color (optional)
fixed: alpha channel color space