The_Lightmapper icon indicating copy to clipboard operation
The_Lightmapper copied to clipboard

Changes to Material data causes error in ID decrementing

Open EthanMichalicek opened this issue 4 years ago • 3 comments

This seems to happen when a change is made to a material on a light mapped object. Not sure what change was made, but I think it was a name change. Once this error showed up, light baking broke for one of the materials in question. This error only seems to appear when Don't apply materials is checked.

image

Additionally, completely deleting all material data (orphan data included) and remaking them all from scratch seemed to not fix the issue. I suspect the only option here is to recreate the file.

Edit: For reference, I am using Blender 2.9

EthanMichalicek avatar Sep 28 '20 18:09 EthanMichalicek

Upon further inspection, this error seems to be separate from whatever was preventing the baking from completing properly on certain objects.

EthanMichalicek avatar Sep 28 '20 19:09 EthanMichalicek

Hi, thanks for reporting this bug

Changing materials on already baked materials generally isn't supported, unless you're sure they're finished baking, I've yet to make an event listener for checking edited materials - Similar to other engines (such as UE4), changes generally require re-baking of the light, although it's especially prone to errors when names are changed in the baked state.

The original materials are hidden, but can be restored by searching for .MaterialName_Original (the dot hides the material from the list). The ID decrement error comes and goes, although it usually doesn't cause any significant errors.

In any case, I'll try investigating the issue

Naxela avatar Sep 29 '20 10:09 Naxela

Gotcha. I still have no idea what directly caused the baking error though (one of the objects came out flat gray every time I hit bake) - if/when I find out I'll open a new issue for it.

EthanMichalicek avatar Sep 29 '20 14:09 EthanMichalicek