vrm-c / UniVRM

UniVRM is a gltf-based VRM format implementation for Unity. English is here https://vrm.dev/en/ . 日本語 はこちら https://vrm.dev/
https://vrm.dev/en
MIT License
2.63k stars 423 forks source link

Fail to convert, "IndexOutOfRange Exception" critical error #1099

Closed Caseritto closed 3 years ago

Caseritto commented 3 years ago

Describe the bug

Imported FBX, when exporting VRM fails and creates an error:

IndexOutOfRangeException: Index was outside the bounds of the array. UniGLTF.MeshExporter_SharedVertexBuffer.Export (UniGLTF.glTF gltf, System.Int32 bufferIndex, UniGLTF.MeshExportInfo unityMesh, System.Collections.Generic.List1[T] unityMaterials, UniGLTF.IAxisInverter axisInverter, UniGLTF.MeshExportSettings settings) (at Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExporter_SharedVertexBuffer.cs:121) UniGLTF.gltfExporter.Export (UniGLTF.MeshExportSettings meshExportSettings, VRMShaders.ITextureSerializer textureSerializer) (at Assets/UniGLTF/Runtime/UniGLTF/IO/gltfExporter.cs:246) VRM.VRMEditorExporter.Export (UnityEngine.GameObject exportRoot, VRM.VRMMetaObject meta, VRM.VRMExportSettings settings, System.Collections.Generic.List1[T] destroy) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:229) VRM.VRMEditorExporter.Export (UnityEngine.GameObject exportRoot, VRM.VRMMetaObject meta, VRM.VRMExportSettings settings) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:24) VRM.VRMExporterWizard.ExportPath (System.String path) (at Assets/VRM/Editor/Format/VRMExporterWizard.cs:275) UniGLTF.ExportDialogBase.EndGUI () (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:161) UniGLTF.ExportDialogBase.OnGUI () (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:82) System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342) UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336) UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310) UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:361) UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:320) UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266) UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438) UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421) UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401) UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:511) UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307) UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176) UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245) UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68) UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Expected behavior

The exporter would create a VRM from my FBX avatar

Environments (please complete the following information):

Windows 11 (dev channel) Unity 2018.4.20f1 UniVRM 0.78.0

ousttrue commented 3 years ago

cube

I guess the fbx's topology is not triangles. Non triangle model can not export.

Caseritto commented 3 years ago

That was it!! Thank you!