Hi. I have a issue about editor crash when calling Lightmapping.ClearLightingDataAsset().
I used Unity 2019.2.10f1, and created automated lightmapping script (processing target scene and bake lightmap by calling Lightmapping.Bake() in batch mode).
The problem is that editor simply crashes at Lightmapping.ClearLightingDataAsset(). Bake() calls Lightmapping.ClearLightingDataAsset() internally so regardless of calling Lightmapping.ClearLightingDataAsset() manually, it crashes.
But not always, sometimes success, sometimes crashes. Is anyone suffering from this problem?
@JenniferNordwall Unfortunately, this issue can’t be reproduced new/small project.
I tried to avoid this issue by calling Lightmapping.Clear() (not ClearLightingDataAsset) before Lightmapping.Bake(). It seems to work but I’m not sure.
Hm ok. If you can file a bug with a repo project, we should be able to have a look. Doesn’t have to be a tiny one either, we just need to be able to make sure that we can repo it on our end so that we know if it’s fixed
After changing to Lightmapping.Clear(), editor does not crash “before baking”. But after baking, it just crashes but stack trace is empty. error.log shows like this:
It seems related to Pyhsx Cloth component, but I didn’t use that.
@JenniferNordwall I found that enabling OptixDenoiser makes crashes after baking lightmaps. When I change denoiser to OpenImageDenoiser, it dones’t crash anymore. Both Unity 2019.2.10f1 and 2019.2.17f1 has this issue.
Edit : Disabling OptixDenoiser doesn’t work for large scene. Still crashed.
I think I found temporary workaround for this issue.
Before scene loading, I deleted LightingData.asset manually by using File.Delete() (AssetDatabase.DeleteAsset doesn’t work) and AssetDatabase.Refresh(), then open scene and calling Bake() from script. No more crashes.
(But I should delete unused lightmap textures manually.)