guycalledfrank / bakery-issues

Bug tracker for Bakery
4 stars 0 forks source link

Bakery throwing KeyNotFoundException at 100% rendering #139

Open schemaxxx opened 2 years ago

schemaxxx commented 2 years ago

Bakery window gets stuck at 100% "Finished Rendering" with Exception in the Unity Editor:

KeyNotFoundException: The given key 'UnityEngine.SceneManagement.Scene' was not present in the dictionary. System.Collections.Generic.Dictionary'2[TKey,TValue].get_Item (TKey key) (at <6073cf49ed704e958b8a66d540dea948>:0) ftRenderLightmap+<ApplyBakedData>d__283.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:7113) ftRenderLightmap+<RenderLightmapFunc>d__282.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:6829) ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4601) UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <31b86d204baf45de8328f2d1261a79f7>:0)

Bakery_settings

All graphics settings are on except RTX since im rendering lightmaps for terrain.

guycalledfrank commented 2 years ago

Can you check if it happens with the latest patch? https://geom.io/bakery/wiki/index.php?title=Github_access

schemaxxx commented 2 years ago

Will do.

schemaxxx commented 2 years ago

I just confirmed that unfortunately, the same exception is being thrown on the latest patch. The line number did change slightly:

KeyNotFoundException: The given key 'UnityEngine.SceneManagement.Scene' was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <6073cf49ed704e958b8a66d540dea948>:0)
ftRenderLightmap+<ApplyBakedData>d__290.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:7175)
ftRenderLightmap+<RenderLightmapFunc>d__288.MoveNext () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:6805)
ftRenderLightmap.RenderLightmapUpdate () (at Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs:4707)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <31b86d204baf45de8328f2d1261a79f7>:0)
schemaxxx commented 2 years ago

The scene I'm using is Unity's terrain demo. I created a skylight and added the Bakery Direct Light to the default SunLight.

schemaxxx commented 2 years ago

I might have an idea why this is happening. I merged two scenes in unity (the terrain & a character scene for testing). Could this be the reason why it fails at the end?

I will do some more testing.

schemaxxx commented 2 years ago

No, it unfortunately also happened with a single scene. A scene containing just simple static geometry (a room with flat walls, no terrain). Same error thrown as above.

schemaxxx commented 2 years ago

It seems like the error happens, when the prompt to save the temp scene pops up and the scene was saved.

guycalledfrank commented 2 years ago

Weird. I never saw this error on any scene. I don't know what is the terrain demo you test. Maybe the temp scene that is opened for light probe preparation is somehow still loaded after the bake? Anyway, can you try updating via the patcher/github again? Just added a bit of validation around that line, so the script should continue (but can print a more informative error to the console).