From bffd7aab41da3e601788ec3ff030094a2a9dd1cb Mon Sep 17 00:00:00 2001 From: Michael Burt <23486102+bikemurt@users.noreply.github.com> Date: Sat, 12 Aug 2023 13:01:11 -0400 Subject: [PATCH] Workaround for Diffuse Baking The Principled BSDF shader doesn't bake the Diffuse (Base Color) properly when the metallic is not zero. This workaround is for using a Custom Pass with the property set to Base Color. Did some testing and is working for me when baking out PBR work flow (Base Color, Metallic, Roughness, Normal). --- bakelab_bake.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bakelab_bake.py b/bakelab_bake.py index 88cd478..acfe5b2 100644 --- a/bakelab_bake.py +++ b/bakelab_bake.py @@ -535,6 +535,8 @@ def PrepareMaterials(self, context, dst_obj, src_obj_list, map, bake_image): if map.type == 'CustomPass': if map.deep_search: self.ungroup_nodes(mat.node_tree) + if "Base Color" in map.pass_name: + mat.metallic = 0 self.passes_to_emit_node(mat, map.pass_name) if map.type == 'Albedo': self.ungroup_nodes(mat.node_tree)