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

"KeyNotFoundException" when Delete Unused Components is On #47

Closed
Yan-K opened this issue Aug 25, 2023 · 2 comments
Closed

"KeyNotFoundException" when Delete Unused Components is On #47

Yan-K opened this issue Aug 25, 2023 · 2 comments

Comments

@Yan-K
Copy link

Yan-K commented Aug 25, 2023

I can successfully use Full preset with Delete Unused Components turned off, but when I try to create optimized copy with Delete Unused Components ticked, it gives following error:

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
d4rkAvatarOptimizer+<>c__DisplayClass205_1.<CombineAndOptimizeMaterials>b__21 (d4rkAvatarOptimizer+MaterialSlot slot) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:3336)
System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Set`1[TElement].UnionWith (System.Collections.Generic.IEnumerable`1[T] other) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable+DistinctIterator`1[TSource].FillSet () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable+DistinctIterator`1[TSource].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkAvatarOptimizer+<>c__DisplayClass205_1.<CombineAndOptimizeMaterials>b__4 (System.Collections.Generic.List`1[T] list) (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:3336)
System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
d4rkAvatarOptimizer.CombineAndOptimizeMaterials () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:3336)
d4rkAvatarOptimizer.Optimize () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizer.cs:154)
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/d4rkAvatarOptimizerEditor.cs:130)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a259d3c004024353a2c217da97495055>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

@d4rkc0d3r
Copy link
Owner

I made it log a warning instead of crashing if this happens again. It might cause other issues though so keep an eye out for it.

@Yan-K
Copy link
Author

Yan-K commented Aug 29, 2023

Thank you so much! newer version works perfectly.

@Yan-K Yan-K closed this as completed Aug 29, 2023
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