Principled Baker - Bake PBR textures with a few clicks (for 2.80 and 2.79)

I tried starting blender from VSC with the Blender Dev extension but got the same result.
Well, I’ll be checking the github repo in the next days. Thank you for looking at this and for your awesome work!

Thank you!
Nice… so I’m in the right place! :slight_smile:
Now just a simple question. How to use it?
Is there a tutorial or documentation to follow?
If my object to bake is inside a scene with other many objects how could I say to the addon to bake that object (or objects)

Thanks in advance

Not entirely unusable, don’t know why but in the especified folder the textures are black, but in the blender folder (the one with the executable) the textures are saved correctly :smile:

There is no documentation right now.

Only selected objects are taken in consideration. Just select it.
Combined is for objects that share UV maps.
Single/Batch bakes every object separately.


That’s a stupid bug with relative vs absolute paths. Will be fixed soon.

1 Like

Hi. Is PrincipledBaker automatically setting the tile size to the texure resolution of the bake.
There is a big big speed up.
Did it wrong for a long time.

Probably a stupid question (I’m quite sure it is) :smile: : is this addon baking just principled shader?
If I have a principled and a transparent as inputs of a mix shader, will it be baked?

update 0.3.4

  • fixed: blender dir as absolute path

The add-on makes no changes under Render > Performance. If certain settings gives better performance, feel free to set up what you like. I have the Auto Tile Size add-on active. Works fine for me.


It should. But it doesn’t. That must be a bug. (edit: should be fixed by now)

1 Like

update 0.3.5

  • fixed: Alpha autodetection
  • fixed: wrong Color with Alpha mix

It does work now! Thank you very much for this awesome addon.
Question, how can I bake AO and Color if there is no AO input in Principled? I tried mixing the AO node to the Color, this bakes AO Correctly but no Color.


Then I tried with the AO Node disconnected, this bakes Color correctly but no AO.

Thank you!

1 Like

That’s a bug. Thanks for reporting!

1 Like

update 0.3.6

  • fixed: incorrect Color, if Ambient Occlusion mixed in with MixRGB
  • fixed: incorrect Ambient Occlusion, if mixed with MixRGB
  • fixed: support for one AO node only
  • fixed: autodetection and baking not working with groups

The Ambient Occlusion fixes should cover the most common use cases. If not, report bugs!

The update is for 2.80 only. The update for 2.79 is pending.
I’ll drop the support for 2.79 in the near future with the release of Blender 2.80 ahead.

1 Like

Awesome, thank you so much!
Could I submit a Feature Request? Ability to pack bakes in a texture for Unity or Unreal Engine:

Unity Standard or LWRP:

  • Roughness: Color Alpha or Metallic Alpha.

or

Unity HDRP

  • Red channel: Metallic.
  • Green channel: Ambient occlusion.
  • Blue channel: Detail map mask. (Ignore for now)
  • Alpha channel: Smoothness (Glossiness).

UE4:

  • Roughness: Green Channel.
  • Metallic: Red Channel.
  • Ambient Occlusion: Blue Channel.

Or just the Ability to set Bakes to RGB Channels.

:v:

1 Like

Of course!

I have that on my nice-to-have-feature list already, but on the bottom. (basic functionality and bug fixes go first) For now you have to use external tools or write a script for image magic to get the automation.

What I have in mind fits your last suggestion: The user can decide which baked result goes in which of the 4 channels of a new image file. Plus the ability to save presets to make a general (not hard coded) tool.
I’m not sure how the UI will look like and how to get the functionality for multiple image files done.

2 Likes

update 0.3.6 (for Blender 2.79)

  • fixed: autodetection and baking not working with groups

It’s easy to pack 3 images together using the Combine RGB node but I’m not sure how to pack anything into the alpha channel. Just bake the result to a UV-mapped plane.
-I always thought baking to the alpha channel in Blender wasn’t supported but I may be wrong about that, but you can do it using GIMP. https://www.youtube.com/watch?v=pGPJhT5lUpE
With UE4 we are only supposed to use 3 channels anyways since a 4th channel triggers a second texture load(It’s a bad design choice by Epic.)

I change the color space once the image gets where it’s going, ie: UE4/Unity.

Here’s a link with lot’s of confusing color-space nonsense to hurt your brain. https://forum.unity.com/threads/save-normal-occlusion-metallic-texture-maps-in-linear-space.380195/

update 0.3.7

  • fixed: directory not created

This hopefully ends the stupid path mumbo jumbo once and for all.

I think, I’m not going to use the Combine RGB node. I’m not aware of a method to bake something into the 4th channel, too.
I’ll probably keep abusing numpy after everything is baked and saved into image files to create a new image. Like it’s already done with the ‘Alpha channel to Color’ option. Here is the code snipped:

def get_combined_images(img1, img2, from_channel, to_channel):
    n = 4
    size = img1.size[0] * img1.size[1]
    a = numpy.array(img1.pixels).reshape(size, n)
    b = numpy.array(img2.pixels).reshape(size, n)
    a[:, to_channel] = b[:, from_channel]  # numpy magic happens here
    return a.reshape(size * n)
2 Likes

Also did it wrong.
I think i lost around 100h of computation time.
It should at least part of the documentation as an recommendation or something like that.
Sure it is a optimisation setting. But in this case not so easy to see.

Aidy Burrows just mentioned Principled Baker in a new video he posted on Twitter. :slight_smile:

time=11m45s

1 Like

I can take the responsibility on this :sweat_smile: . From the previous Youtube video comments:

2 Likes