Principled Baker - Bake PBR textures with a few clicks

Really nicely made, thank you!

update 0.1.3:
port to blender 2.8

Itā€™s just a port. no bug fixes.

Hi, thanks for sharing
Blender 2.79
79

Blender 2.80.35 (update 0.1.3)
2%2C80
Bake ??

Awesome! Great to have this in 2.8, thanks!

Err, how the hack did that happen? Iā€™m fixing ā€¦

update 0.1.4:
bugfix: missing bake button

2 Likes

Hi. Great work. Iā€™ve tried to install the addon (0.1.4) in blender 2.8, iā€™ve added the files to the addons folder, the addon is showing in the preferences, and i can enable it, but canā€™t find it in the UI.
Where can I find it?

1 Like

The tab is in the properties panel of the Shader Editor. Also in Compositing and Texture Node Editor, but this is a bug!

Iā€™m currently reworking the add-on, because there are a number of bugs and missing features.

1 Like

This add-on is amazing! Very useful! Thank you DanielEngler!

1 Like

Thank you man!
Iā€™ve managed to find the addon and used it a bit. Itā€™s amazing. Thank you very much, I know how hard is to code this kind of things.
I wanted to report a littleā€¦ bug? that Iā€™ve foundā€¦ When, in a shader, you have multiple output material nodes (i use them a lot to preview the result of the output of some nodes in the node tree) the metallic channel renders to black in all the baked textures. (For example, if I have a principled node with a red color in the diffuse channel, and it has the metallic slider set tu 1.0, the baked color texture renders black instead of red) In order to get the baker to work, I have to delete all outputs nodes and leave just the final one.

I dont really have a problem with it, but I thought the possibility of making that a feature. Would it be posible, in the addon, to have the possibility to pick wich output node to bake? That would be useful in a case were the user wanted to test, for example, two differents color combinations for a given material. He could configure one node tree with two outputs, and just pick up the one he wants to bake. Besides, there would be no need to erase manually all the outputs nodes placed for testing (iĀ“m sure im not the only one doing it).
It is just an idea tha came to my mind, I donā€™t know if it would be possible to implement.

Have a good day!

1 Like

Yes, thatā€™s a bug. Iā€™ll fix it with the next release, that should be done in a few days. Iā€™m currently reworking the confusing UI besides fixing bugs. So, thanks for reporting.

There is an easy solution for this. Just let the active Material Output node be the one for baking. This way you get what you see.

But, if I have more than one output, the metallic bake failsā€¦ xD
Anyways, would it be cool to be able to pick up the desired node from the addon itself (a list?)
If the node tree is very big, navigating trough it to find the desired output node could be confusing or time consuming, so the list might help. :slight_smile:
I have a bit of experience with coding, but I dont know anything about python and blender programming. But I am willing to learn the basics and try to implement that feature myself :stuck_out_tongue:

You have to have a Metallic input linked or at least two Metallic values with different values somewhere in the node tree. That itā€™s not working with the current version is a bug.

A list in the UI will work fine for one selected object. For more selected objects at the same time (batch baking or multiple selected to active) the list will become a unnecessary confusing heap of Material Outputs. I want to keep it as simple to use as possible.

You can always make a fork. No problem with that!
I was familiar with Python before. All I learned about writing add-ons for Blender I did with this and the other add-on I made.

1 Like

What about thisā€¦ a button that says something likeā€¦ batch procesing, you press it and an outliner-like window with all the output nodes listed (or thumbs views) shows up, where you can do multiple selection over them, you select the ones that you want, click ok. And then bake.
The addon UI would only need to show that litlle button. The pop up window or panel for node selection would be showed only during selection and would go away with user confirmation or cancelation.
If that still doesnā€™t appeal to youā€¦ well no problem. If I had how to pay you to implement that feature, Iā€™d do it, cause Iā€™ve been already missing it. But, since I live in Venezuela and is virtually imposible here to do e-paymentsā€¦ or have the money (at last for me) Then Iā€™ll try to find the time and knowledege to implement it myself, along with an option for inverting the output of the channels (useful for some PBR workflows like unity, where the metalness workflow uses a glossiness map for roughness)
Again, many thanks for the Add on, it is amazing. :slight_smile:

An option (EnumProperty) with ā€œbake active Material Outputā€ (default), ā€œbake selected Material Outputsā€, ā€œbake all Material Outputsā€ is possible. An issue will be the texture names/file names/paths that have to be unique and consistent, to prevent accidental overrides. I might put this on the todo list, but with low priority.

The inverted roughness for glossiness workflow is already on the todo list.
(btw: Unity supports roughness workflow. But I understand, that people want to keep a consistent workflow through an entire project.)

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

1 Like

Hello there! I wanted to try your addon but I got an error :disappointed_relieved:
This kind of addon would be very useful for me. Please help me.
My Blender 2.80 build: 8a51af7d1c98 (2019-01-31)

Traceback (most recent call last):
File ā€œ/home/viadvena/.config/blender/2.80/scripts/addons/Principled-Baker-master/pbaker_bake.pyā€, line 720, in execute
image = self.new_bake_image(obj.name, job_name)
File ā€œ/home/viadvena/.config/blender/2.80/scripts/addons/Principled-Baker-master/pbaker_bake.pyā€, line 388, in new_bake_image
image = self.new_image(image_file_name, image_alpha)
File ā€œ/home/viadvena/.config/blender/2.80/scripts/addons/Principled-Baker-master/pbaker_bake.pyā€, line 335, in new_image
image.save()
RuntimeError: Error: Image ā€˜Cube_color.png.003ā€™ could not be saved to ā€˜alfa/TMP/Baker/Cube_color.pngā€™

location: :-1

Oh, thatā€™s a stupid bug. :confused:
The image file path (on Linux) should start with a ā€˜/ā€™ (eg. ā€˜/path/to/image.pngā€™)
As a workaround you could try to put a second slash before the file path, like this: ā€˜//alfa/TMP/Baker/ā€™

Iā€™ll fix this tomorrow.
This happens when you test on Windows only. :roll_eyes:

1 Like

Thank you for answer. Iā€™ll be waiting for updates)
And itā€™s great that I participated in testing your great addon on my OS :nerd_face:

By the way if you could implement baking in Eevee it would be super awesome!
Donā€™t understand why Blender devs push me to bake in Cycles every time when I need itā€¦

update 0.1.6:
bugfix: file paths
other bugfixes

File paths should be working properly, now.


Thatā€™s out of my power. :smile:
I already thought about temporary changing to Cycles and after baking back to Eevee. But I had some crashes with the alpha and beta just by changing the render engine. So i dropped it. This could be an option, till the blender devs make baking in Eevee possible.

1 Like