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

Unchecking Merge Static meshes as skinned causes errors #19

Closed
Asovrix opened this issue Dec 4, 2022 · 6 comments
Closed

Unchecking Merge Static meshes as skinned causes errors #19

Asovrix opened this issue Dec 4, 2022 · 6 comments

Comments

@Asovrix
Copy link

Asovrix commented Dec 4, 2022

I have quite a complex avatar with some props that I do not want to get merged as meshes, since I suspect it could break stuff.
Unchecking Merge Static Meshes as Skinned or Merge Skinned Meshes causes Merge preview and Debug info to disappear and spews a lot of the same error in console:

IndexOutOfRangeException: Index was outside the bounds of the array.
d4rkAvatarOptimizerEditor.OnInspectorGUI () (at Assets/d4rkAvatarOptimizer/src/d4rkAvatarOptimizerEditor.cs:2999)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Edit: after some debugging it seems that even just adding AvatarProp root object from ThatFatKidsMom prefab as an exclusion to optimizer causes above error. Adding "object container" for your prop works fine.
Link to that prefab: https://github.com/ThatFatKidsMom/Avatar-Prop

@Asovrix
Copy link
Author

Asovrix commented Dec 4, 2022

I can still press Create optimized copy, it takes a while because of how large this avatar is, but it produces a copy tagged with (BrokenCopy).
The reason I do not want to merge static meshes is because one of them can be dropped in world (VRLabs World Constraint), some not and one of them is even using ThatFatKidsMom's Avatar Prop prefab, which allows that prop to be manipulated by other players as if it was a world prop.

@d4rkc0d3r
Copy link
Owner

d4rkc0d3r commented Dec 4, 2022

Have you tried if it actually does what you want with the settings enabled? When merging static meshes to skinned meshes the vertices of that previously static mesh will get weight painted to the transform it was previously on.

@Asovrix
Copy link
Author

Asovrix commented Dec 4, 2022

No, it spits out a broken copy. I need to manually exclude props for it to create something not broken, but aside from that I still have unrelated issues... materials turning pink, material losing reference to its maintex only once avatar is loaded and object that should be toggleable being stuck enabled.
I guess at least for pink material I should create a separate issue?

@Asovrix
Copy link
Author

Asovrix commented Dec 4, 2022

Okay, I found exactly what is causing titular issue, it's a mesh called "Cull" that is a part of Avatar Prop package. If I add it to exclusions it immediately causes optimizer script to spit out same errors. Changing name doesn't do anything.
It looks like this:
Unity_2022-12-04_18-06-43
My guess is it's the fact that it has 0 materials?

@d4rkc0d3r
Copy link
Owner

Yeah is def the fact it has 0 materials. I did not account for that to happen.
Thanks for the detailed report, I'll probably fix it tomorrow.

@d4rkc0d3r
Copy link
Owner

As usual get the fix by downloading the current repo form here.

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