しろつきのノート

しろつきの創作用のメモ

VRM3

今日は、VRMの続きやってた。今日で完成出来るかな〜と思ってたらエラーでた

 

IndexOutOfRangeException: Array index is out of range.
VRM.VRMSpringUtility+<ExportSecondary>c__AnonStorey0.<>m__0 (VRM.VRMSpringBoneColliderGroup x) (at Assets/VRM/Scripts/SpringBone/VRMSpringUtility.cs:155)colliders.IndexOf(x)
System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[VRM.VRMSpringBoneColliderGroup,System.Int32].MoveNext ()
System.Collections.Generic.List`1[System.Int32].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[System.Int32]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[Int32] (IEnumerable`1 source)
VRM.VRMSpringUtility.ExportSecondary (UnityEngine.Transform root, System.Collections.Generic.List`1 nodes, System.Action`1 addSecondaryColliderGroup, System.Action`1 addSecondaryGroup) (at Assets/VRM/Scripts/SpringBone/VRMSpringUtility.cs:159)
VRM.VRMExporter._Export (VRM.glTF_VRM gltf, VRM.VRMExporter exporter, UnityEngine.GameObject go) (at Assets/VRM/Scripts/Format/VRMExporter.cs:108)
VRM.VRMExporter.Export (UnityEngine.GameObject go, System.String path, System.Action`1 callback) (at Assets/VRM/Scripts/Format/VRMExporter.cs:27)
VRM.VRMExporterWizard.OnWizardCreate () (at Assets/VRM/Scripts/Format/Editor/VRMExporterMenu.cs:104)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object
parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.ScriptableWizard.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/ScriptableWizard.cs:79)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object
parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object
parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:104)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:216)

 

昔もエラー出て何回も作り直したの思い出した、何直したらいいかわからんから作りなおしてたんか 今になってもわからん

作り直すの面倒だから、すぐ直るなら直したいよーーーなんとかして分からんかね?調べたけど出なかったわ

 

何となくスクリプト開いてみた。colliders.IndexOf(x)が-1だとこのエラーが出るらしい、colliders.IndexOf(x)ってなんやねん

少し前見ると、var colliders = new List<VRMSpringBoneColliderGroup>();ってあった。

リストだから、モデルの一番下に付いてあったsecondaryってやつのリストのやつかねと思って見たらColliderGroupの要素2個なぜか消えてた、入れたらエクスポート出来た!直った!!

やっぱ新しく作るよりこっちの方が楽やったな、なんとかなってよかたア

エクスポートしたやつの事は次にするかあ今日長い