specoolar / Blender-BakeLab2

Blender addon for baking images
GNU General Public License v3.0
304 stars 44 forks source link

Doesn't respect "Clear image" being disabled? #7

Open tonpix opened 3 years ago

tonpix commented 3 years ago

I want to bake surface normals + Bevel node normals from multiple objects into 1 normal atlas map, without having objects nearby interferencing results. Seems only way is to use Individual Objects, which does what I need, except one thing - it results in multiple results (all of them sharing the same UV map for atlas, but different parts of it, per object). To solve it, I untick "Clear image" in Render Properties > Output), which causes 1 texture atlas to be reused by multiple results, granting that way a one nicely packaged 1 normal atlas that keeps surface+Bevel normals, without other objects casting unwanted normals. The problem is, I get this result using blender's native baker. BakeLab doesn't have this option, nor respects if "Clear image" is ticked or un-ticked - the results from BakeLab are multiple, non-packed normal maps. Not sure if I missed something.

specoolar commented 3 years ago

Because the addon doesn't bake to an existing image, instead creates a new image everytime. Maybe you need to change Bake Mode to "All to One Image", this way you can bake the Normals of multiple objects to one image

tonpix commented 3 years ago

I've tried "All to One Image", but it uses raytraced distance, so nearby objects cast normals on other surfaces, which I don't want. image There's example, a separate object is attached to flat surface and it causes additional normal info on that large flat surface normal. Wouldn't it be possible to add option for BakeLab2 to add variant of "All to One Image" that bakes objects separately and puts their bakes into 1 packed atlas?

specoolar commented 3 years ago

Hmm, yes you are right, i will add this option later

On Sun, 13 Dec 2020, 05:10 tonpix, notifications@github.com wrote:

I've tried "All to One Image", but it uses raytraced distance, so nearby objects cast normals on other surfaces, which I don't want. [image: image] https://user-images.githubusercontent.com/13473971/101999674-ba8b5880-3cdf-11eb-96fa-cefbcc5c6b0d.png There's example, a separate object is attached to flat surface and it causes additional normal info on that large flat surface normal. Wouldn't it be possible to add option for BakeLab2 to add variant of "All to One Image" that bakes objects separately and puts their bakes into 1 packed atlas?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Shahzod114/Blender-BakeLab2/issues/7#issuecomment-743923871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNUVRUVGIZ3EK6XET63Q3TSUQA6VANCNFSM4UYZWLZA .

specoolar commented 3 years ago

Added. Now there is an option called "Pre-Join meshes". Turn off this to bake objects without raytracing scr

tonpix commented 3 years ago

Thank you for quick add! I've tested and seem to have issues, blender is crashing after baking on 1st of selected objects is done, I can see normal map showing for a second, so might be a image texture saving issue? There's recording below. I can provide .blend file for pilot seat if you think it can help. Happens on 2.90.1, tried 2.91, but addon doesn't seem to install in preferences (after clicking Install, the list of addon doesn't show it on list, so I can't enable) https://streamable.com/byooxl

EDIT: I've changed Output from Save to Pack, crashing occurs after 3rd object bake is done instead 1st. EDIT2: Ticking "Pre-Join meshes" (I believe that was default in earlier versions) - makes baking process finished without hiccups, just that there are raytraced normals

specoolar commented 3 years ago

I've tried on both 2.90.1 and 2.91, works fine. Have you tried baking in a simple scene? Or maybe you need to completely remove the addon, restart Blender and install the addon again. If this doesn't help, send me the .blend file

tonpix commented 3 years ago

Tried your way to reinstall, no change. Fresh scene with default cubes works, but blender's baking never crashed on me on pilot seat - here's .blend file. To get crash, all I need it select parent, then childs and start baking, now it seems to be crashing after random number of objects, once I managed to get progress complete, but no idea what I did. https://drive.google.com/file/d/12x5Ibn8unUkABDSDWHS2xLY2iZQ1vNeY/view?usp=sharing

tonpix commented 3 years ago

Actually, I've copied pilot seat objects to new fresh project (should have thought about it when you suggested fresh scene) and baking went without problems. So it seems my project or cached addon settings are somehow interferencing? Do you have a idea how to fix it? I could copy all other objects from my complete project to new, but I fear it might take time to adjust other project settings, animations etc., so if it's possible, I'd like to fix .blend file that has issues. Is there a way to reset addon settings inside project? image

specoolar commented 3 years ago

It's weird. when I maximize(ctrl+space) the 3D View before baking blender doesn't crash. Look's like blender trying to update everything after every bake, thus causing crash

tonpix commented 3 years ago

Ctrl+Space doesn't prevent crashes in my case, unfortunately. Any ideas what I could do more, what might be culprit?