Bake Wrangler - Node based baking tool set

Hi there, I’m loving this addon. Saves me so much time. But now I encountered an Error

When I try to bake into Alpha channel I get Bake Error, but only when I connect the Color from the Bake pass to the Alpha Socket of the Output Image Path

I tried to follow the guide for this Node under Section 4, but it results in the bake error.
https://bake-wrangler.readthedocs.io/en/latest/output_imagepath.html?highlight=alpha#output-image-

  1. Alpha: If the output image format supports an alpha channel and ‘RGBA’ mode has been selected, then each connected socket will also have an ‘Alpha’ input below it. A value or color can be used as input (if a color is connected a drop down will appear to select what channel to use, the default being pixel value). Alpha channels are always created in Linear space as this is what OpenGL, etc expects.

This is the material:

and the bake recipe(connecting the links with the red arrow summons the error):

The error message I get in the text editor when I ctrl+click on the BW Icon on the bottom right:

Blender 3.3.0 (hash 0759f671ce1f built 2022-09-07 00:44:18)
Read blend: C:\Users\smitty2\AppData\Local\Temp\blender_a17692\bake.blend
Error: Shapekey KEKey.004 has an invalid 'from' pointer (0000000000000000), it will be deleted
Info: Bake Wrangler nodes registered
> Debugging output enabled
Error: Python: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 2393, in <module>
    main()
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 2344, in main
    err = process_tree(args.tree, args.node, args.sock)
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 216, in process_tree
    solutions = process_output_node(node, socket)
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 257, in process_output_node
    solutions[sock] = bake_solution(sock, node.inputs[idx+1])
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 15, in __init__
    self.get_passes(alpha, True)
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 24, in get_passes
    self.add_postproc(node, socket, is_alpha)
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 74, in add_postproc
    self.link_postproc(from_sock, masked_bake.outputs['Bake'])
  File "C:\Users\smitty2\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\BakeWrangler\baker.py", line 170, in link_postproc
    amap_links.new(amap_nodes['Alpha_Map'].outputs[from_sock.input_channel], amap_nodes['Output'].inputs['Alpha'])
KeyError: 'bpy_prop_collection[key]: key "R" not found'

Blender quit

Is there anything else I can try?

Its an issue caused by changes in Blender 3.3 which replaced some of the materials nodes. If you update to the 1.4 Beta of Bake Wrangler it should be working (or used Blender 3.2). The other way is to use the Split RGB post node as it wasn’t effected by the changes.

Yes, update to Version 1.4 helped. Thanks

I’m trying to bake several trim sheets onto a mesh (Albedo Pass). Which works fine and is so much easier than messing around with Substance Designer and doing tens of Transfer texture bakes. Thumbs up for that!

I want a soft fade out on some of these trim sheets. To do that, I simply put a few planes with gradients on top of them. It seems though that Alpha is ignored when baking. Is this normal behavior or can it be done some way?

Viewport (Cycles):

Bake:
image

Yeah, so Alpha being a property of the material rather than the mesh doesn’t usually effect baking. The ray just hits the first surface and returns the value.

I created the Billboard baking node for this. It works basically backwards to normal baking, but it can pass through objects with alpha in their materials. Give it a try and see if that gets the results you want. It is a bit slower and needs more samples than normal though.

2 Likes

So I have mostly designed and written an implementation for vertex color output… The system I’ve currently settled on is a two step process:

  1. You bake as normal, vertex color data is output to files (one file per data set per object) in your current blender sessions temp file path.

  2. Once the bake completes a second button will be enabled on the node which will read the data from those files and apply it to your active session. I think the default mode will lock the interface while it applies it to try and avoid any crashes, but I guess there could be a preference to make it backgroud if you want to risk it…

The big thing missing is that currently the post process nodes are completely ignored for vertex color output… In theory though there is no reason vertex colors from the same object can’t be mixed together, it’s just not supported by the existing system…

Thank you for this addon! Incredibly useful.

Happy new year everyone, 1.4 Beta 4 is now uploaded. This adds the Vertex Color output node.

The data is stored in temp files until you use the apply or discard button the node or you close blender. Baking again will also delete the current data set.

There is one small bug, that I forget to turn off checking for a UV map. So you will need to add a UV map, but it can be empty.

2 Likes

It seems maybe a UV map is needed to bake normals to vertex colors properly? I’m just getting an empty set when trying to get normals with no UV map. Some other passes seem to work though…

Hi @netherby first of all thanks for your great addon ! I encountered an issue on any baking pass i try… Maybe i do something wrong :
I work with Blender 3.4.1 and Bake wrangler 1.4b4

I try to bake with this parameter with very simple meshes for testing first :


I have a low poly cube mesh with :

  • No matérials
  • 1 empty Vertexs color attributes
  • 1 Uv map
  • No modifiers
    And I have a High poly cube mesh with :
  • Multires modifiers
  • 1 matérials on Principled BSDF shaders with bump normal map
  • 1 Uv map
  • 1 empty Vertexs color attributes

On any kind of baking pass (Albedo on PBR, Diffuse on Blender, etc) with GPU or CPU render, i obtain a black image and a python error like this :

Python: Traceback (most recent call last):
File “C:\Users.…Blender\3.4\scripts\addons\BakeWrangler\nodes\node_tree.py”, line 822, in modal
node.vert_files.append(vfile)
AttributeError: ‘BakeWrangler_Output_Image_Path’ object has no attribute ‘vert_files’

Best regards

Yeah, sorry there is a bug in the b4 version and it can ONLY bake vertex colors >_<

No problems the version 1.3.6 work like a charm, on blender 3.4.1 !! Great job your addon is awesome. Impatient to testing the new features of 1.4 :wink:

I was too busy testing the new stuff and somehow missed that you can’t bake normally… I thought I tested it, but yeah somehow slipped through. Once I get the batch baking working for vertex colors I will upload a fixed version.

Get the 1.4 beta 5 now, everything should be fixed including using batch node with vertex and mixed outputs, but let me know if there are any bugs!

1 Like

Great !! i will test this right now thanks.

@netherby

Hey
I come back to you for version 1.4b5,
with identical parameters I still get a black image on all bakes passes types on CPU or GPU,

But the python errors go away :slight_smile:

Capture of my simple test blend file :

The détails of log :

Info: Bake Wrangler nodes registered
Processing [Output Image Path (Image)]: Creating 1 images

Pass: [Bake Pass (ALBEDO)]
[Mesh Nodes (1)]
Mesh: [Input Mesh] [Targets (1)]
-Baking ALBEDO pass:
Blender 3.4.0
Read blend:
Fra:1 Mem:16.01M (Peak 16.13M) | Time:02:36:18.33 | Mem:0.00M, Peak:0.00M | bake_Bake Pass (ALBEDO)_Input Mesh_Cube | Synchronizing object | BW_Cube.001
Fra:1 Mem:16.01M (Peak 16.13M) | Time:02:36:18.33 | Mem:0.00M, Peak:0.00M | bake_Bake Pass (ALBEDO)_Input Mesh_Cube | Initializing
Fra:1 Mem:16.01M (Peak 16.13M) | Time:02:36:18.33 | Mem:0.00M, Peak:0.00M | bake_Bake Pass (ALBEDO)_Input Mesh_Cube | Updating Images | Loading Bake Pass (ALBEDO)
Completed in 0:00:00.077502

Image: [Image.jpg]
-Performing post bake processing
Fra:1 Mem:76.85M (Peak 76.85M) | Time:02:36:18.42 | Mem:0.00M, Peak:0.00M | BakeWrangler_Post | Synchronizing object | BW_Post_SMOOTHNESS
Fra:1 Mem:76.85M (Peak 76.85M) | Time:02:36:18.42 | Mem:0.00M, Peak:0.00M | BakeWrangler_Post | Synchronizing object | BW_MatPlane
Fra:1 Mem:76.85M (Peak 76.85M) | Time:02:36:18.42 | Mem:0.00M, Peak:0.00M | BakeWrangler_Post | Initializing
Fra:1 Mem:76.85M (Peak 76.85M) | Time:02:36:18.42 | Mem:0.00M, Peak:0.00M | BakeWrangler_Post | Updating Images | Loading Bake Pass (ALBEDO)
Fra:1 Mem:80.85M (Peak 80.85M) | Time:02:36:18.42 | Mem:0.00M, Peak:0.00M | BakeWrangler_Post | Updating Images | Loading bw_default_orig
Info: Baking map saved to internal image, save it externally or pack it
-Writing changes to …

Bake wrangler 1.3.6 still work perfectly :slight_smile:

:frowning: having no errors makes life difficult!

Well, with BakeWrangler version 1.4.0, everything I tested works normally on Blender 3.4.
In particular, the channel map node and all baking passes work.

What I find strange is that under version 1.4.5 and 1.4.5 only, if I launch a baking pass without a vertex color attributes Bake wrangler return an error like this :

Info: Bake Wrangler nodes registered

Debugging output enabled
Processing [Output Image Path (Image)]: Creating 1 images

Pass: [Bake Pass (ALBEDO)]
[Mesh Nodes (1)]
Mesh: [Input Mesh] [Targets (1)]
Preparing material [Material_Bake Pass_Input Mesh_Cube] for [ALBEDO] bake
Chosen output [Material Output] descending tree:
OUTPUT_MATERIAL:Surface->Material Output:None
EMISSION:Color->Principled BSDF:BSDF
Reached branch end,
Not linked, value will be copied
Linking: Emission to Material Output
Real bake type set to [EMIT]
-Baking ALBEDO pass:
Blender 3.3.1 (hash b292cfe5a936 built 2022-10-05 00:49:25)
Read blend:
Error: Mesh does not have an active color attribute “Cube.002”
Error: Mesh does not have an active color attribute “Cube.002”
Error: Mesh does not have an active color attribute “Cube.002”

But in other version it’s possible to bake without it.

moreover I really tried everything but alls baking pass return black void image in 1.4.5. and debug mod return this on PBR albedo pass, for example, and RGB vertex color attributes implemented :

Debugging output enabled
Processing [Output Image Path (Image)]: Creating 1 images

Pass: [Bake Pass (ALBEDO)] [Mesh Nodes (1)]
Mesh: [Input Mesh] [Targets (1)]
Preparing material [Material_Bake Pass_Input Mesh_Cube] for [ALBEDO] bake
Chosen output [Material Output] descending tree:
Reached branch end, Not linked, value will be copied
Linking: Emission to Material Output
Real bake type set to [EMIT]
-Baking ALBEDO pass: Completed in 0:00:00.065492

Image: [Image.png]
-Performing post bake processing
-Writing changes to …

I hope I was able to help a little for the debugging, good luck and thanks !

Okay! Beta 6 should fix all issues :stuck_out_tongue:

It is also only missing post processing node support for vertex colors… Which I think I will add? Dunno if it’s worth the time tho…

This also is probably it for v1. I can’t improve UDIM without changes to Blenders python API and anything else is kinda hard to spend the time on given it probably wont result in any sales…

Wow what a responsiveness!! Version 1.4.6 fixes all the issues I could have.
About the implementation of post processing nodes for vertex colors I think it’s worth it because it still opens up possibilities.
Maybe it is possible to offer a more expensive version, personally I am ready to pay more for a version with more functionality ^^

But the support and maintenance of the current version is already huge.

Thanks!