Bake Wrangler - Node based baking tool set

My experience has been, that if reporting bugs is even the slightest bit difficult, most people will just move on.

I my case, I had no blenderartists account, so I had to create one.
Then, as a new user, I was at trust level 0, so no uploads and limited links allowed.
So, Need to upload the reproduction file somewhere else.
Also, the long thread is difficult to search, so checking if someone already had a similar problem is difficult.

Just as a suggestion: Since you are already using Github pages for the documentation,
creating a separate (empty) repo just for bug reports and bug tracking might work for you.
I donā€™t know if this would be easier for most people, but it would certainly have been easier for me.

Yeah, I agree the entry level for reporting is too high. I think github still has the issue that someone needs to create an account in order to report an issue?

Ideally you would just be able to report the bug without any additional steps. I know myself if I have to create an account to do something that instantly reduces the chances I will be bothered to do it.

1 Like

Also the bug you found is a use case I never consideredā€¦ That being that you would combine multiple bake passes into the final image, but also split the output into separate files.

The output splitting and udim splitting was something I tacked onto the existing system. So itā€™s a bit hacky. One day I will rewrite itā€¦ Any way the problem is that my strategy with the split output is to save the file as soon as the bake for it completes, which doesnā€™t work when the file is the combination of multiple passes that havenā€™t been completed yet.

That means I probably need to change to baking everything first and keeping the results in memoryā€¦

1 Like

Hey, are there any plans to add nodes for logically combining and negating sets of objects? Iā€™ve found myself wanting for this multiple times over the course of a few projects.

1 Like

Itā€™s not something Iā€™ve considered. I assumed people would just make groups of the objects they wanted with the Objects node or via Collections. You could also use the Sorting node to include/exclude based on the objects name.

What is the use case for it? (I mean, ANDing/ORing Objects nodes should be pretty simple, but Iā€™m not sure I understand how you want to use it)

Iā€™ve fixed the issue. Please try using v1.2.3 and confirm that it works correctly now!

1 Like

No, no, that was just a hack, because combining only the channels gave a bake error.

I am programming in my day job (not with python though), and if experience has told me anything, than it is this: That ā€œone dayā€ will never come. However much I would like to do it, there is just never time/budget for it.

I just tried it. I had just enough time for a quick run with the file I posted before, but I seems to work now.
Great work, thanks!

1 Like

It will get rewritten when there is some reason to do a major update of the system (like if they ever add the baking API that we were supposed to get as part of Cycles X) :stuck_out_tongue:

2 Likes

Huh, I didnā€™t know about the sorting node. That might be enough for my purposes. Thanks for the quick reply.

One use case Iā€™ve encountered recently: baking a mesh thatā€™s in the same collection as used for scene, where taking it out of that collection just for baking would be tedious. If thereā€™s a subd mod on the mesh in this scenario it seems to bake the mesh twice, ruining the bake.

OTOH that might just be a bug. On attempt to reproduce I noticed without the subd modifier involved this will bake fine. BA doesnā€™t seem to want to let me upload an example file, but if itā€™s needed I can find a way. This happened with 2.93 LTS + BakeWrangler 1.2.2

I think the solution in that case is just to have duplicate meshes in the scene removed automatically. I donā€™t think there is any case where you would want duplicatesā€¦ The main reason I didnā€™t do this already was that I hadnā€™t seen that it actually made any difference.

You can also probably get the subd mod mesh to work by changing some of your mod settings. The most likely case is that the baked mesh and the scene mesh are being rendered at different subd levels and it causes interference (render level vs view level).

But removing duplicates from the scene automatically probably wonā€™t hurt anything.

The mismatched viewport and render subd levels was exactly it. Thank you :slight_smile: That may be a case worth throwing a warning about during bake if nothing else.

Iā€™ll post again if I run into another usecase for and/not nodes.

So recently encountered an error when using your plugin
Not really sure what went wrong since it just trows out a generic
Failed error and the debug in blender doesnā€™t show much more

Here is the blender debug and the log file that your plugin generated

the main issue is probably my blender version

OS: Arch Linux
Blender Version: v3.0
Plugin Version: v1.2.3

It could also be your operating system. From the log the problem is that your margin distance is being cast as a float, when an int is expected. I donā€™t think this happens on Windowsā€¦

Do you have a margin distance set and if so what value are you using? If you could also test this on Blender 2.9x it might be interesting. But donā€™t go out of your way if thatā€™s a hassle!

(I believe this is a Linux python issue, as I cannot reproduce it on Windows. Can I give you a patch or get you to edit one of the files to try a fix?)

So tested with different margins but still get the same result so its probably a Linux python issue (also tried updating everything but no change).
i would love to patch it myself but its kind of hard trying to work out where to begin

but with directions i could probably manage i suspect its just forcing it to return an int instead of a float
but i could be wrong havenā€™t really experimented with python in blender.

its not that much hassle that it doesnā€™t work right now since i am getting my windows rig back in early January. but would be nice to test some things.

sorry for the late reply been kind of bizzy over Xmas

(quick update used the alternate margin method and that worked fine all tho slow)

Yeah the alternative margin will work, its faster the more tightly packed your UV islands are. Big empty areas slows that method down a lot.

If you open up baker.py in the top level of the addon, go to line 1106:

margin=mesh_settings["margin"],

just change that to:

margin=int(mesh_settings["margin"]),

should fix the problem by forcing a cast to int. If that works I will change it in the next version.

it works fine now thanks.

kind of weird that this only happens in Linux

Iā€™m guessing either python on linux makes a different choice about what type to use when you multiply an int with a float or there is some difference in how blender reads the valueā€¦

It could be an actual bug in either the windows or linux version of python included in blender, since you would expect them to use the same data type given the same instructions :stuck_out_tongue:

(Also Iā€™m pretty sure python should be using a float for the value, which would make the linux version correct. But then blender should really do the cast to int. But I donā€™t have a handy linux system to test it on and see where the difference is.)

Hi @netherby,
Iā€™m not sure if it is the best place to send Bug report or Feature request :slight_smile:

I most of the time separate my HD and LD mesh in two different Blend file for organisation purpose, and Iā€™m linking my HD in the LD file.

At the moment the bake fails when trying to apply modifiers on linked mesh, and it would simplify a lot the process and keep a non destructive way of baking if it could be handle by the addon.
Maybe making the data local before applying if it detects that the data is linked

Error applying modifier 'Subdivision' to object 'mesh_HD'
Traceback (most recent call last):
  File "C:\path_to_blender\scripts\addons\BakeWrangler\baker.py", line 1483, in prep_object_for_bake
    bpy.ops.object.modifier_apply(modifier=mod.name)
  File "E:\path_to_blender\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.modifier_apply.poll() Cannot edit modifiers coming from linked data in a library override

Thanks in advance.

EDIT :
Just adding the make local command before applying works fine for me (at line 1530 on v1.2.3)

if object.type == 'MESH':
    bpy.ops.object.make_local(type='SELECT_OBJECT')
    bpy.ops.object.modifier_apply(modifier=mod.name)
1 Like

This is fine for either!

Baking linked objects is just one of those use cases I never considered or tested :stuck_out_tongue: If the make_local command works I will just include that in the next versionā€¦

1 Like

Thanks That would be great if someone else could benefit from it ! I hope there is not any side effects. Iā€™ll let you know if I see any downside of this modification :wink: