Principled Baker (for blender 2.8 and 2.79) (bake PBR textures from Principled BSDF nodes)

free
texturing
add-ons
(DanielEngler) #1

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


Principled Baker add-on helps you bake all inputs of Principled BSDFs (and others) to image textures.

Features:

  • Autodetect of what needs to be baked
    – Bake only linked inputs of Principled BSDFs (and other surface shaders)
    and
    – Bake inputs with values that differ in different nodes
  • Manual selection for texture channels
  • 3 bake modes: Combined, Single/Batch, Selected to Active
    • 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.

Limitations/Warnings:

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

  • Baking works in Cycles only. (for now)

  • 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

  • bake Ambient Occlusion only from one node per material (highest node in tree)

  • new Ambient Occlusion texture is not connected in newly generated material

  • Vertex Color baking only works, if the object has a material (will be fixed)

  • Auto Smart UV Project 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!

  • 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.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

(puns are intended)

9 Likes

How bake cycles material to PBR texture
Export image from node editor
Save bake image as 32 bit float?
(joseph raccoon) #2

I think I shall make use of this.

0 Likes

(Craig Jones) #3

Interesting, thank you for this!

0 Likes

(urkokul) #4

Usefull thing. Thanks

0 Likes

(joseph raccoon) #5

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

0 Likes

(PixelPete) #6

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:

0 Likes

(Spirou4D) #7

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

0 Likes

(kabu) #8

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


Os X, Blender 2.79/2.79a

0 Likes

(DanielEngler) #9

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

Important! Download the update 0.0.2!

0 Likes

(DanielEngler) #10

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:

0 Likes

(DanielEngler) #11

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.

0 Likes

(DanielEngler) #12

update 0.0.4:
new: optional new Material

removed: optional new Principled BSDF node for manual preview

fixed: overwrite with new resolution bug

0 Likes

(DanielEngler) #13

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

0 Likes

(renderhjs) #14

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!!!

1 Like

(DanielEngler) #15

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:

0 Likes

(renderhjs) #16

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.

0 Likes

How to make new Material Output node the active one?
(DanielEngler) #17

Yes, same idea - different approaches.

0 Likes

(DanielEngler) #18

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

0 Likes

(DanielEngler) #19

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.

0 Likes

(DanielEngler) #20

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

0 Likes