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

[BUG] "The VRCSDK build was aborted because the VRCSDKPreprocessAvatarCallback 'AvatarBuildHook' reported a failure." #129

Closed
Rycia opened this issue Oct 15, 2024 · 3 comments

Comments

@Rycia
Copy link

Rycia commented Oct 15, 2024

I came across this error when building for quest and for the life of me I can't figure out what it is.

image
image
image
image
image
image
image

System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at d4rkAvatarOptimizer.FindAllPhysBoneDependencies () [0x0033f] in .\Packages\d4rkpl4y3r.d4rkavataroptimizer\Editor\d4rkAvatarOptimizer.cs:2251 
  at d4rkAvatarOptimizer.FindAllPhysBonesToDisable () [0x00010] in .\Packages\d4rkpl4y3r.d4rkavataroptimizer\Editor\d4rkAvatarOptimizer.cs:2308 
  at d4rkAvatarOptimizer.Optimize () [0x0014c] in .\Packages\d4rkpl4y3r.d4rkavataroptimizer\Editor\d4rkAvatarOptimizer.cs:155 
  at d4rkpl4y3r.AvatarOptimizer.AvatarBuildHook.OnPreprocessAvatar (UnityEngine.GameObject avatarGameObject) [0x00045] in .\Packages\d4rkpl4y3r.d4rkavataroptimizer\Editor\AvatarBuildHook.cs:37 
UnityEngine.Logger:Log (UnityEngine.LogType,object)
(wrapper dynamic-method) UnityEngine.Debug:UnityEngine.Debug.LogError_Patch1 (object)
d4rkpl4y3r.AvatarOptimizer.AvatarBuildHook:OnPreprocessAvatar (UnityEngine.GameObject) (at ./Packages/d4rkpl4y3r.d4rkavataroptimizer/Editor/AvatarBuildHook.cs:42)
VRC.SDKBase.Editor.BuildPipeline.VRCBuildPipelineCallbacks:OnPreprocessAvatar (UnityEngine.GameObject)
nadena.dev.ndmf.ApplyOnPlay:MaybeProcessAvatar (nadena.dev.ndmf.runtime.ApplyOnPlayGlobalActivator/OnDemandSource,UnityEngine.MonoBehaviour) (at ./Packages/nadena.dev.ndmf/Editor/ApplyOnPlay.cs:98)
nadena.dev.ndmf.runtime.AvatarActivator:Awake () (at ./Packages/nadena.dev.ndmf/Runtime/ApplyOnPlayGlobalActivator.cs:187)
UnityEngine.GameObject:AddComponent<nadena.dev.ndmf.runtime.AvatarActivator> ()
nadena.dev.ndmf.runtime.RuntimeUtil:GetOrAddComponent<nadena.dev.ndmf.runtime.AvatarActivator> (UnityEngine.GameObject) (at ./Packages/nadena.dev.ndmf/Runtime/RuntimeUtil.cs:33)
nadena.dev.ndmf.runtime.ApplyOnPlayGlobalActivator:Awake () (at ./Packages/nadena.dev.ndmf/Runtime/ApplyOnPlayGlobalActivator.cs:125)
The VRCSDK build was aborted because the VRCSDKPreprocessAvatarCallback 'AvatarBuildHook' reported a failure.
UnityEngine.Logger:Log (UnityEngine.LogType,object)
(wrapper dynamic-method) UnityEngine.Debug:UnityEngine.Debug.LogError_Patch1 (object)
VRC.SDKBase.Editor.BuildPipeline.VRCBuildPipelineCallbacks:OnPreprocessAvatar (UnityEngine.GameObject)
nadena.dev.ndmf.ApplyOnPlay:MaybeProcessAvatar (nadena.dev.ndmf.runtime.ApplyOnPlayGlobalActivator/OnDemandSource,UnityEngine.MonoBehaviour) (at ./Packages/nadena.dev.ndmf/Editor/ApplyOnPlay.cs:98)
nadena.dev.ndmf.runtime.AvatarActivator:Awake () (at ./Packages/nadena.dev.ndmf/Runtime/ApplyOnPlayGlobalActivator.cs:187)
UnityEngine.GameObject:AddComponent<nadena.dev.ndmf.runtime.AvatarActivator> ()
nadena.dev.ndmf.runtime.RuntimeUtil:GetOrAddComponent<nadena.dev.ndmf.runtime.AvatarActivator> (UnityEngine.GameObject) (at ./Packages/nadena.dev.ndmf/Runtime/RuntimeUtil.cs:33)
nadena.dev.ndmf.runtime.ApplyOnPlayGlobalActivator:Awake () (at ./Packages/nadena.dev.ndmf/Runtime/ApplyOnPlayGlobalActivator.cs:125)

Also getting this after saving the avatar prefab after trying to turn off delete unused objects (with no different of a result.)
{19FB8C45-367E-4F90-82EF-ED2B3C8604A0}

Also confirmed my avatar works fine when I remove the d4rk optimizer component completely.
Also fails when the component is added with none of the options except apply on upload is on;
{4069A4DD-E1C5-4010-8BA5-4B6A88FC3393}

@d4rkc0d3r
Copy link
Owner

Uh oh. That error means you have a skinned mesh that does something really weird. It has at least one vertex that references a bone id that is larger than the list of bones in the skinned mesh renderer. That should not be a thing a mesh has.

Shouldn't be hard for me to log some warnings instead of producing an error though.

@Rycia
Copy link
Author

Rycia commented Oct 15, 2024

If you could log which skinned mesh has the issue, that'd be super helpful too.

@d4rkc0d3r
Copy link
Owner

This should now be a warning instead of a crash in 3.9.1

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