Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to bake complex prefabs causes index out of range error #6

Open
erikbaender opened this issue Aug 18, 2022 · 1 comment
Open

Comments

@erikbaender
Copy link

This plugin is amazing, but unfortunately it breaks down when you throw prefabs with a large amount of static components at it:

Assertion failed on expression: 'm_PendingLightmapHashes.size() == m_LightmapCompositeHashes.size()'

IndexOutOfRangeException: Index was outside the bounds of the array.
PrefabLightMapBaker.Baker.SaveSceneLightmap (System.Int32 lightmap_index, System.String name) (at Assets/Plugins/PrefabBaker/Scripts/Editor/Baker.cs:202)
PrefabLightMapBaker.Baker.GetOrSaveSceneLightmapToAsset (System.Int32 lightmap_index, System.String name) (at Assets/Plugins/PrefabBaker/Scripts/Editor/Baker.cs:157)
PrefabLightMapBaker.Baker+<>c__DisplayClass8_0.<SaveLightmaps>b__1 (UnityEngine.MeshRenderer r) (at Assets/Plugins/PrefabBaker/Scripts/Editor/Baker.cs:130)
System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) (at <c2a97e0383e8404c9fc0ae19d58f57f1>:0)
PrefabLightMapBaker.Baker+<>c.<SaveLightmaps>b__8_0 (PrefabLightMapBaker.PrefabBaker prefab) (at Assets/Plugins/PrefabBaker/Scripts/Editor/Baker.cs:130)
System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) (at <c2a97e0383e8404c9fc0ae19d58f57f1>:0)
PrefabLightMapBaker.Baker.SaveLightmaps () (at Assets/Plugins/PrefabBaker/Scripts/Editor/Baker.cs:124)
PrefabLightMapBaker.Baker.OnBakeComplete () (at Assets/Plugins/PrefabBaker/Scripts/Editor/Baker.cs:90)
UnityEditor.Lightmapping.Internal_CallBakeCompletedFunctions () (at <5f40cdb07bd44d76a23dad985a4ec283>:0)

I already tried playing around with all the available settings like baked / mixed mode and texture size, they don't seem to make a difference. This error always occurs right after baking is finished.

@nukadelic
Copy link
Owner

share an example project to replicate this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants