Bake Wrangler - Node based baking tool set

Hi thanks for your answer. The object is already unwrapped. I achieve an AO map and a cavity map perfect for them.
What do you mean about keyframe ?
This is my blend file test_bake_wrangler.blend (1.6 MB)

Hi @Anubisbis currently the Curvature map requires a way to derive tangent space surface normals. That means the object either needs a material that provides a normal map or you need a high poly object to project onto the target.

I do plan on making a system without these limitations, but it’s not planned for 1.0… The current version only really works well for high to low poly baking.

A solution you could try is to add a multiresolution modifier and subdivide once. Use the multiresolution bake with Normals selected, then add the resulting map to your object as a normal map. Baking Curvature should then work. Another alternative is to duplicate your object, subdivide mod it and use it as the Source in the bake (simpler, but the results may not be as good).

@hyyou Adding a way to select the keyframe is something I may add in the future. It would mean changing how the objects are created though, potentially needing multiple versions of the same object from different frames… Maybe it actually needs a entire new node which could some how allow baking a range of key frames… I think I need more information on how people would want to use such a feature.

I will however change the current version to use the set frame number instead of the first frame.

2 Likes

Thanks @netherby
Because my test is an hard surface object I can’t subdivide it. I will to do a retopo to have the twice objects.

Totally agree, and many thanks.

Perfect with a retopo.
If you can do it without second mesh it will be powerful for hard surface model. I’m the developer of Fluent addon (hard surface modeling), I discovered your addon yesterday, I’m going to be following your work very closely.
I have a suggestion : is it possible to have an option (checkbox) with cavity to bake with inverted normal of the mesh ? It’s perfect to get the edges.

I have some ideas for how it can be done, I just need to do some experiments on it…

I can definitely have an inverted cavity map, though maybe that should be its own pass? I think you could use it to make a ‘thickness’ map maybe?

1 Like

In fact I use this trick to get edges and use it with smart material (example painted material with damaged edges).
Yes you can make a separate pass “invert cavity”.

I’m trying to add this option in your addon…dev addict :sweat_smile:

Done ! ahah I add the option and it works. So good this addon ! Perfect.


Now I can bake edges and cavity in separate image or merge them together.

1 Like

I’m happy to integrate other peoples code if you want to send me changes :stuck_out_tongue:

I sent a private message with modified files and explainations. :slightly_smiling_face:

2 Likes

Thanks, I’m into anything that saves me time :wink: I just need to decide if it should be packaged as a different pass…

I’m currently trying to improve the layout of the more messy nodes and want to try having some of the more advanced and less used options collapsed under a panel or something to start with.

In my personal opinion, having a new pass that would be called “Edges” would be easier to understand for new users.

1 Like

Hey @netherby

The addon looks great, but I have a quesstion:

I have an object with two materials, and I want each material to be bake in it’s own texture set (one texture set per material), I don’t want to fuse them.

Is there a way to do so?
Right now the results overlap.

Thanks!

  1. Bug: I got a hard-to-reproduce bug that (rarely) makes the bake failed :-

File “”, line 1, in
File “xxx\addons\BakeWrangler\baker.py”, line 1477, in main()
File “xxx\addons\BakeWrangler\baker.py”, line 1446, in main
… bpy.ops.object.mode_set(mode=‘OBJECT’)
File “xxx\2.83\scripts\modules\bpy\ops.py”, line 201, in call
… ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect

It can always be workaround-ed by clicking any object in the scene(make it active).
My two cents, to activate the OBJECT context, at least 1 object must be both visible and active.

Something like :-
bpy.context.scene.objects.active =bpy.data.objects[args[0]]
probably should be added to the addon just before bpy.ops.object.mode_set(mode='OBJECT') (line 1446 of baker.py RC4).

  1. Bug : If the destination object is invisible, the bake will always fail.

  2. Feature request : after I use your great addon for baking 20+ texture,
    now I wish for a way to change some “custom properties” just before every baking.

image

The value of custom properties can be used as driver that can manipulate almost everything in Blender. This can become a very powerful and flexible feature (better than index of animating frame).

Here is the photoshop-ed preview :-


Many thanks!

Here is python code reference related to custom property. https://blender.stackexchange.com/questions/43785/adding-other-types-of-custom-properties/43786#43786

Edit: Add image; Edit2: add python reference.

(I am not the add-on developer.)
Can you provide blend file/image? Here is my wild guess :-

  • My first choice will be duplicating the object, set material manually then create 2 Bake joined via Batch Bake. It is far from ideal though.

  • My next choice is creating a new material, then mix 2 material together via Mix Shader.
    There will be a “fac” value of the Mix Shader.
    Bind the “fac” to a driver that linked to a new Custom Property of a world.
    For baking, adjust the newly-created custom property =0, then bake, then set it to =1, then press another bake.
    Batch Bake node is not useful for this approach.
    Edit: Driver is not actually needed, but it makes thing more convenient.

All of the options I provided need 2 “Output Image Path” nodes.

You can’t bake one object and split the output by material. You have to duplicate the object and put one material on each version. You can split the output by UV Map, which could work (one map for each material).

What you describe is possible in Blenders bake, by having different texture nodes in each material (which must be active and selected) pointing to different files. But that’s not something I can really support easily and it’s a kinda confusing way to do things in any case.

In the future perhaps there will be a way to bake a material ID map higher in the stack and have that split outputs. But that won’t be any time soon.

@hyyou I was aware of that problem. My current fix was to just check if it’s in object mode before trying to set object mode. I think that covers all the weird cases where it was breaking…

I’ve been unsure how to address object visibility. On one hand I could just make all the selected objects visible, but on the other users may want to use it to exclude objects from a bake… I could have it refuse to start if the target isn’t visible?

How do you want to set the custom value? Just write the new value into the node?

but when you say by UV Map… I don’t fully understand it, I mean, if I select by UV Map I cannot decide which material do I want to be baked, and the UV’s of each material overlap, that’s the point of having multiple materials.

The duplicate thing is not a good option when dealing with rigged scenes.
Couldn’t you, in the addon, generate such geometry copies in a transparent way for the user? so there is no actaul modiication to the working scene and the addon handles such duplicates.
Generating one “snapshopt” mesh per material with the corresponding material applied.

Thanks for the answer :slight_smile:

Create a UV map where you delete/scale to zero all the faces that have the texture you don’t want on them (easy to do because you can just select by material and get all of them). Then when baking you can have one UV map go to one image and the other to a different one.

I could have the add-on split the output by material, yes. But it’s not a common use case? I’m not saying it will never be an option.

It’s a really common use case in reality. For example, Substance Painter bake this way.

I don’t know how your addon works, but it’s not simply delete/ignore the low poly mesh with different material?