SimpleBake - Simple Pbr And Other Baking In Blender

Is the “asset with 20 parts” a single object with 20 separate meshes that are joined together and that’s why you have to “explode all of the [separate loose parts]”?

SimpleBake kind of negates Clear Image I think because it’s (in my opinion, incorrectly) recreating the image for every bake. So even though I modified it not to touch Clear Image, it still doesn’t work because the second time I hit bake with Clear Image unchecked, the image’s contents get wiped out. I’m looking into fixing it though.

Yeah, the author has a high opinion of the flag :smiley:

    #Turn off that dam use clear.
    bpy.context.scene.render.bake.use_clear = False

This is in a function that gets run for every kind of bake.

No, they would be all separate objects, but would be exported as a single .fbx to Substance Painter or a game engine, for example. The reason they need to be exploded is because each object will have a ‘virtual cage’ used to project/cast rays onto the mesh when baking. Think of that cage like a copy of the mesh pushed out along it’s normals, so if they were all baked together the cages would intersect and rays from one cage would project onto another. Substance Painter deals with this by naming meshes and it will only bake pairs of meshes flagged with the same predefined name. Exploding is sort of the ‘old school’ way around this. Or in Max it’s done by matching predefined material IDs.

Hehe. it would appear so. :laughing:

Yes, this is what happens in Textools too. It doesn’t respect the flag and simply ignores it.

Great tool - Are you planning to support udims? Can we run this in command line?

Thanks

Can you guys advise if it’s possible to bake normal including ‘Weighted Normal’ modifier data without applying this modifier?
This is what I get not applying the modifier: original vs baked

I think you might be confused about the difference… A normal map is in addition to mesh normals. So you don’t bake weighted normals to a texture, those are applied to the bake target’s mesh normals in geometry data. So your low poly would need the weighted normals prior to baking normal textures and remain as part of face normals on export (so in another render enging, you would import nomrals-face).

In other words, there’s no other way than (in this case) applying both Bevel and Weighted Normal modifiers before baking, right?

Hi,
Thanks a lot for this great addon.

I am currently looking for a way to use your it on an assets library (Chocofur Lifetime Bundle) to make it ready for export to Sketchfab (to populate our Archviz models). However I have two problems : a lot of the shader nodes are inside node groups, and a lot of these shaders are Glossy BSDF or Diffuse BSDF.

The second issue I think I might be able to resolve with a script to convert the shader nodes to Principled BSDF; but would it be feasible on the addon side to PBR bake a material that has its shaders inside node groups (provided they’re Principled BSDF, Emission or Mix Shader as per your specifications) ? Currently all PBR maps except the Normal one come of as black.

Wow. Sorry. No one was really posting on this thread, so I sort of stopped checking it (I tend to engage with people via Blender Market). Today I logged in for a different reason and boom - 20 replies. Gave me quite a shock.

I will do my best to answer what I can.

Honest answer - not sure. If it’s not something you can do in Blender manually (??), then I can’t really do it in SimpleBake (sorry, I’m just not that good). I am not sure how I would do that manually in Blender, so I am not sure how I would do it in SimpleBake.

As @obsurveyor in the thread points out, SimpleBake forces this to on for each bake, so you always replaces past bakes. This is mostly to avoid confusion for users (I want SimpleBake to “start fresh” each time) and stop SimpleBake baking on top of existing images. As @obsurveyor also eventually discovered, you have the “Multiple objects to one texture set” option.

That option doesn’t work with Use Alpha. I discovered early on that, for some reason (??), if you bake to same image twice, and that image has alpha, the alpha is replaced by Black. I don’t know why - perhaps someone can explain it to me.

So that’s kind of why I ended up where I did with those options.

That’s odd. It should definitely work. I just tested it again now to make sure I hadn’t broken it somewhere along the way, and it seemed OK… I baked a cube and got an image with alpha background.

See above. The issue I was having with those options combined is that any second bake to an image with alpha seemed to remove the alpha, and no matter what options I passed to the operator I couldn’t get a different result.

Happy to work around this issue, I just don’t know how.

Yeah that’s true… or mostly true. When you are using the PBR Bake function you are basically just baking emission, so I took the view that 16 was enough.

When you are baking using the Cycles Bake function (more akin to “traditional” Blender baking - or just plain old rendering) then SimpleBake will honour whatever sample count you have set.

See the Blender Market FAQs.

Can you tell I’m not a professional coder from my… less than professional comments?? :joy:

Yep you are right. SimpleBake kind of tries to “start fresh” with every bake. So existing images are destroyed, new ones created, and the clear flag is disabled. It was giving me a very annoying conflict at one point with another function - hence that comment.

When Blender itself supports UDIMS, there will be the possibility for SimpleBake to support UDIMS. Before that, no - I am limited to what you could do manually in Blender. I am definitely not good enough to single-handedly bring UDIMS to Blender.

SimpleBake only supports PBR textures created around the Principled BSDF node. Anything using Glossy and Diffuse nodes is not supported for PBR bakes - only CyclesBake. See the Blender Market FAQs.

Node groups are a limitation that I have never managed to work around. I’ve asked on the dev forums and Stack Exchange, but I’ve yet to find any way to “unpack” node groups from a Python script in a reliable way. Note that you CAN use node groups, but the shaders (i.e. the Principled BSDF, Emission and Mix Shaders) must sit outside the groups. From what you have said, however, I don’t believe this will help you. Sorry.

As above, unfortunately not. The shaders must be outside the node groups. I don’t know a way around that at the moment. If they are hiding inside the node groups then SimpleBake cannot find them. My ideal would be to “unpack” all node groups at the start of the bake, but no one knows how. If you examine the code of SimpleBake, you can still see the remains of my aborted attempts to do this.


I’ll try and check this thread more often, though as I’ve told a few people on Blender Market I have a lot going on at the moment (don’t we all?) and SimpleBake hasn’t been getting the attention it deserves. I am still bug fixing as stuff comes up, but some of my bigger and wilder plans for new functionality have been pushed back a bit.

All the best.

This would be quite difficult to change. Right back to version 0.1, SimpleBake has been based around starting fresh with each bake. I wanted it to be simple (hence the name). I didn’t want people to have images being baked over other images, or loads of duplicates.

It was a core design decision for me. I coded SimpleBake for people who just wanted no hassle baking - and my original aim was really to make it easy to get stuff to Sketchfab.

I get how people might disagree, but I still hold true to that principle.

So much of the other code assumes that you are always “starting fresh”, that I think it would be extremely difficult to change that concept (though I’m always happy to be proven wrong).

Version 4.6.0 released. Adds some initial channel packing functionality. Full details in the second post.

2 Likes

Hey @Belistner, I’m playing with baking multiple objects to one atlas and I got some remarks/questions:

  1. If ‘New UV Method’ is set to ‘Smart UV Project’, there are overlapping islands in the output. Margin needs to be set very high to get rid of this
  2. If I bake first atlas with a batch name set as ‘Bake1’ for a couple of objects in the scene, then bake another one for the rest of objects with a batch name set as ‘Bake2’, all objects from Bake1 get textures replaced with Bake2
  3. When using ‘Combine Active UVs’, would it be possible to set a kind of priorities for certain objects, so they take larger space of the UV to retain more details/resolution? It would be great feature. Alternatively, is there a quick way to tweak it manually?
1 Like

Hi @blndrusr

Sorry for the very late reply - I don’t check this thread very often. The best way to contact me regarding issues with SimpleBake is via Blender Market.

  1. That shouldn’t be the case. It could be a bug of some kind, but I have never experienced it myself. I seem to get decent results. Would it be possible to send me a file where this is happening via Blender Market for me to have a look at?

  2. You’re right, this is a bug. The baked images are created correctly, and not overwritten by the following bake (which is good), but the code that creates a material in Blender and assigns the freshly baked textures to a material is doing it for both the newly baked objects and the previous one. So you have to manually change them. I will look into fixing this.

  • Just to note, I only get this bug when I bake the same objects twice with the “Copy objects and apply materials” option. Reading your comment, I am not 100% sure this is what you are describing.
  1. When using the combine active UVs option, you are taking the existing UV maps that each selected object has and merging them into one UV map. So all you have to do is size the UVs as you want them (e.g. making the ones with lots of detail nice an large) and then untick the “Average UV island scale” option in SimpleBake. It will then combine them keeping their original sizes :slight_smile:

Bug tracked down and squished (I hope). Should be fixed by version 4.6.6 released today.

Get it via automatic update in the SimpleBake add-on preferences as usual.

Thanks o lot! Fix confirmed.

1 Like

Version 4.8.1 released. Brings background baking (!) and denoising. See second post for details.

1 Like

I got a small improvement idea: could you add a object picker to the ‘Target Object’ field?
image

2 Likes

Hi

Implemented in version 4.8.6 which I’ve just made live. Auto-update in SimpleBake add-on preferences as usual :slight_smile:

1 Like

I’ve been having some problems with detail on ID maps in Substance Painter baked from Blender vertex colours so I’m trying to bake the ID map in Blender first and it looks like I could do this easily with your add-on either by baking diffuse colour textures or by baking vertex colour maps (in the SimpleBake specials menu), is that right?

Can you also bake scene lighting into diffuse textures with SimpleBake (eg. for an unlit scene in Sketchfab)?

The add-on update functionality is great.

1 Like