Bake Wrangler - Node based baking tool set

Please note that you must create NEW recipes to use with the alpha.

Old ones will not work and will not auto update. This is intentional to prevent accidentally making your old recipes incompatible with the release version of the add-on (Please comment if this makes testing too inconvenient).

Hi, Is it possible to add such a possibility, I selected the objects node, selected the meshes in the viewport, pressed the hotkey and all the selected meshes in viewport were chosen in the objects node ?

You mean adding a hot key for the ‘Add Selected’ button? Because you can do what you want currently by pressing that button on the node.

I mean add hotkey to add source bake frome 3d viewport.
For example i select some of objects in viewport and press hotkey and all they will be added to the list of node “objects” what was selected in node editor

Screenshot_69

Oh, you must be using an older version. The current version has a button:
bwaddsel
Though I think it’s broken in the release. It is working in the 1.2 alpha. I think it could also be assigned to a hot key…

Oh sorry, I am using the old version which was free. Because I was in Crimea and there were sanctions, I could not make purchases. I will buy it soon. The old version works well

Sorry for being late to the party :sweat_smile: but I just tried out the alpha and I really like how you separated the settings into separate nodes. I can def see how this would be useful when baking a lot of maps at once!

Personally I feel no need to port older node systems, especially with these new settings nodes :wink:

However I noticed that it fails to bake jpg (Idk if this has always been the case, just thought I would report it). Im using openEXR (which is probably better anyway) instead so Im not really bothered by it.

Also from one of my previous comments:

If I was to write a wish list for what math functions/operators that I would like to see it would be something like:
Multiplication
Division
Addition
Substraction
Modulo
power
log
Floor
Combine/Separate rgb

(tho I did notice that you already implemented something in style with a combine node with this alpha build :slight_smile: )

I would also like to add round and roof to my list, especially round (to closest whole number). And I think its important that the post process options lets you perform mathmatical operations outside of the 0 to 1 range, so that one could do something like floor(X*10)/10 if they wanted to only allow for 10 possible values within the outputted 0-1 range that then gets written to the image file.

I kinda feel all that math is beyond the scope of this addon. At that point you might as well start designing a whole Substance-style texture compositor.

Not that I’m opposed to it at all, but that sounds daunting :stuck_out_tongue:

I believe he already said in a previous comment that this new system in the alpha should allow for post process effects.

Idk how big of a task something like this would actually be to implement, on my end I could just solve it with some 3rd party software but it would be a nice to have for sure.

I am going to add a math node along with separate split/join nodes. It’s not really part of baking, but I think it’s useful to eliminate extra steps to making the texture ready where possible.

I dunno if it will work out, I’m just going to put one with add/subtract/multiple/divide at first.

There is more to be done with high to low poly work flows. I’m adding a fairly simple name matching system which will allow for automatic pairing of high and low poly objects. But I’m not really sure how to automate having more than one high poly mapping to a single low poly… Similarly I’m unsure about automatically splitting them into different output files…

For the multiple mapping, I can see either supporting some number of specific naming conventions or perhaps letting people specify their own regex… For splitting the outputs it could be as simple as a check box that causes the object name to get added to the file name or something more complicated using tokens to substitute some properties into the name… I’m not really sure what people would want or need in that regard, because the current system works fine for me.

(I will look into the jpg problem, I usually only test png output so it’s good to catch that)

1 Like

Something else that I wonder if it would be possible, is if we could have an option to make the bakes respect alpha (or even better since bake wrangler is node based, if we could use nodes to filter any channel as we like (tho Im unsure how this would actually look in practice)). Like if you look on the below example:

The cube to the right displays the output of baking the cube to the left with a plane and a text slapped to the surface (separate objects “Plane” and “Text”). The shader applied to these objects basically have a noise texture plugged into the alpha channel making it appear partially red.

And as one would expect the alpha here is ignored and you get the pure diffuse, but so basically I think it would be nice if it was possible to make the ray continue through any surfaces hit and layer the result to emulate what it would look like with alphas.

This could be useful when either working with an extension like decal machine or for stuff like this:
image
image
where the extra geometry of the text is undesired.

And just to further motivate this feature (if its possible to implement as a Blender addon at all) real time render engines like UE4s renderer often have issues with rendering alpha (Eevee is an exception as it usually works quite well with its alpha blend mode) as demonstrated in this video (which I would rather like to avoid) : dithered opacity) - YouTube](https://www.youtube.com/watch?v=ieHpTG_P8Q0

And lastly obviously it would be one texture less to bake in situations like these letting you save space on your hard drive if nothing else :wink:

Also some other minor issues that have been bugging me:

  • On the mesh node, if you set the mesh source “objects” to seemingly anything but the exact same “objects” as the target input, the target mesh(es) seem to always be excluded. See this example:


    The red cube (which is a regular default cube) is in this case linked to both the source and target bake collections, yet as demonstrated by the black cube to the right (having the resulting image applied as its albedo) the “Cube” was never included in the bake, despite being in the target collection.

  • If you close the popup console/text editor window the baking process will automatically terminate, not a big deal but still, would be nice if there was an option to either prevent this behaviour or have the console not open up at all :man_shrugging:

I don’t really have any control over how alpha gets treated by the baker… At least not that I’m aware of. Maybe having a ‘Mix’ with factor input node or ‘Multiply’ node would allow a solution?

The way that the source and target fields work is: Every object in the Target list is baked in its own pass and each pass will have all the objects in the Source list projected onto it. But the Targets themselves will not contribute any colors, only the Source objects.

If you want the Target to get its textures baked there are two options. You can add a copy of it to the Source list (I’m reasonably sure I remove the Target from the Source if they are the same object) or you can add a second input mesh with JUST the Target set like:
bw-targpsrc
That should result in the target getting baked on its own and then the sources getting baked on top of it.

Closing the text editor definitely shouldn’t stop the bake, it doesn’t for me… And there are some options to control it. If you go to the add-on in the preferences window and expand it, you should find some options to turn the popup window off.

I don’t really have any control over how alpha gets treated by the baker… At least not that I’m aware of. Maybe having a ‘Mix’ with factor input node or ‘Multiply’ node would allow a solution?

Yeah maybe, if one was to first bake the objects excluding decals, bake the alpha, bake the decals and then use something like a Mix node (or a linear interpolation of any kind). Idk how I would UV unwrap my decals to end up in the right place in the UV space tho without having to adjust it manually? Is there some modifier that can project UV maps or something alike maybe?

Aha. Sorry I thought this was in error

Strange (once again this is not a big deal but still, it does seem to terminate for me at least with the alpha build) :
https://u.teknik.io/1z4f5.mp4

I’m pretty sure it can be done with a mix type node and the right bake order… I will have to think about it…

There may not actually be a good reason to remove the target from the source… My assumption was that if someone did that, it would have been in error. There didn’t seem to be any good reason to bake an object onto itself… But maybe I was wrong?

Okay, yours definitely seems to be stopping when you close the editor… It’s not supposed to… What happens if you turn off the editor pop up in the prefs? I’m really not sure how or why that would be the case… Does this happen for anyone else???

1 Like

Well in my case sometimes I just want to exclude some geometry. But when setting up more of a pipeline I will be making a copy of the object so that I can apply the modifiers.

This makes me to think of that question I had a couple of weeks ago abotu whether I could make an external python script know when bake wrangler has finished. Do you think you could maybe add a node pluggable to the Batch bake node that basically runs a external program or some python script within Blender? So that I as a user could just type in something like the path to a .bat or .py file and it would execute, so if its plugged in as the first node in a batch bake it would execute before the batch bake, if its the last node it would execute after the batch bake. To demonstrate:

image

Usecases would be being able to apply modifiers and such before baking and automatically exporting to a game engine after the bake. So maybe it would be best if it runs some script within Blender so that it can access the Blender API to emulate button presses and stuff, while still being able to fire off external programs.

Ah lmao I totally forgot about this button :sweat_smile: Yeah it does still bake it I have the “Open text in new window” setting disabled.

I may change it to allow having the same object in target and source…

Executing another program wouldn’t be difficult. Running another script in blender should also be fairly simple. But those are two different tasks that need a different approach.

The image I made might have been slightly confusing but if it would let you run some local py script from within Blender you could always just put

import os
os.system("C:\\Pipeline\\someProgram.exe");

in that script as a user

If I were running an external program rather than a script I would want to fork it… But I guess I can just leave that up to the user to screw things up with :stuck_out_tongue:

I could have it run a python script that was either in a blender text block or a file.

I mean that would be amazing! I will be holding my thumbs :stuck_out_tongue:

Just if you go with the file approach, make sure it can read a script from anywhere on the hard drive so that you dont have to append scripts for every blender file or something like that.