UniVRM icon indicating copy to clipboard operation
UniVRM copied to clipboard

NullReferenceException on exporting 2022.3.6f1

Open byeoon opened this issue 1 year ago • 5 comments

Environments (please complete the following information):

  • UniVRM version: 0.122.0
  • Unity version: Unity-2022;.3.6f1
  • OS: Windows 11

Describe the bug

I am unable to export my avatar to .vrm because of this error and I have no idea why it's happening.

  • ConsoleLog
UniGLTF.MeshUtility.MeshAttachInfo+<>c__DisplayClass4_0.<ReplaceMesh>b__0 (UnityEngine.Transform x) (at Assets/UniGLTF/Runtime/MeshUtility/MeshAttachInfo.cs:23)
System.Linq.Enumerable+SelectArrayIterator`2[TSource,TResult].ToArray () (at <de4a1a1490a74771a34fee0d1d586658>:0)
System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <de4a1a1490a74771a34fee0d1d586658>:0)
UniGLTF.MeshUtility.MeshAttachInfo.ReplaceMesh (UnityEngine.GameObject dst) (at Assets/UniGLTF/Runtime/MeshUtility/MeshAttachInfo.cs:23)
UniGLTF.MeshUtility.BoneNormalizer.Replace (UnityEngine.GameObject go, System.Collections.Generic.Dictionary`2[TKey,TValue] meshMap, System.Boolean FreezeRotation, System.Boolean FreezeScaling) (at Assets/UniGLTF/Runtime/MeshUtility/BoneNormalizer.cs:101)
VRM.VRMBoneNormalizer.Execute (UnityEngine.GameObject go, System.Boolean forceTPose) (at Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs:85)
VRM.VRMEditorExporter.Export (UnityEngine.GameObject exportRoot, VRM.VRMMetaObject meta, VRM.VRMExportSettings settings, System.Collections.Generic.List`1[T] destroy) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:205)
VRM.VRMEditorExporter.Export (UnityEngine.GameObject exportRoot, VRM.VRMMetaObject meta, VRM.VRMExportSettings settings) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:25)
VRM.VRMExporterWizard.ExportPath (System.String path) (at Assets/VRM/Editor/Format/VRMExporterWizard.cs:264)
UniGLTF.ExportDialogBase.EndGUI () (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:162)
UniGLTF.ExportDialogBase.OnGUI () (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:82)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <347e3e2bef8c4deb82c9790c6e198135>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <347e3e2bef8c4deb82c9790c6e198135>:0)
UnityEditor.DockArea.OldOnGUI () (at <347e3e2bef8c4deb82c9790c6e198135>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <d30253adcd2a48faba9ee2264e211f5a>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <4397ca26b8a24183a25a95ffae967e39>:0)
  • ScreenShot

image

  • Reproduction procedure I have no idea how to reproduce this since it's only happening on my avatar.

  • File that causes an error (those that can be pasted here) N/A

byeoon avatar Jun 10 '24 23:06 byeoon

I manually installed 1.0 from the repository and I still get the same issue.

image

UniVRM10.ModelExporter+<>c__DisplayClass10_0.<CreateSkin>b__0 (UnityEngine.Transform x) (at Assets/VRM10/Runtime/IO/Model/ModelExporter.cs:310)
System.Linq.Enumerable+SelectArrayIterator`2[TSource,TResult].ToList () (at <de4a1a1490a74771a34fee0d1d586658>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <de4a1a1490a74771a34fee0d1d586658>:0)
UniVRM10.ModelExporter.CreateSkin (UniGLTF.INativeArrayManager arrayManager, UnityEngine.SkinnedMeshRenderer skinnedMeshRenderer, System.Collections.Generic.Dictionary`2[TKey,TValue] nodes, UnityEngine.GameObject root) (at Assets/VRM10/Runtime/IO/Model/ModelExporter.cs:310)
UniVRM10.ModelExporter._Export (UniGLTF.INativeArrayManager arrayManager, UnityEngine.GameObject root) (at Assets/VRM10/Runtime/IO/Model/ModelExporter.cs:139)
UniVRM10.ModelExporter.Export (UniGLTF.INativeArrayManager arrayManager, UnityEngine.GameObject root) (at Assets/VRM10/Runtime/IO/Model/ModelExporter.cs:31)
UniVRM10.VRM10ExportDialog.ExportPath (System.String path) (at Assets/VRM10/Editor/Vrm10ExportDialog.cs:310)
UnityEngine.Debug:LogException(Exception)
UniVRM10.VRM10ExportDialog:ExportPath(String) (at Assets/VRM10/Editor/Vrm10ExportDialog.cs:343)
UniGLTF.ExportDialogBase:EndGUI() (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:162)
UniGLTF.ExportDialogBase:OnGUI() (at Assets/UniGLTF/Editor/UniGLTF/ExportDialog/ExportDialogBase.cs:82)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

byeoon avatar Jun 10 '24 23:06 byeoon

The fix mentioned in #2206 seems to work on 1.0, but I want 0.x because that's how to export to VSeeFace. Unfortunately that doesn't work because the code provided doesn't exist.

byeoon avatar Jun 11 '24 00:06 byeoon

womp womp

PolarGMCOfficial avatar Jun 11 '24 00:06 PolarGMCOfficial

womp womp

haha i fixed it

I went to version 0.112.0 and exported it there, although the only remaining issue is that I don't have blendshapes (??) image

byeoon avatar Jun 11 '24 00:06 byeoon

MeshAttachInfo.cs:23

#2326

ousttrue avatar Jun 20 '24 11:06 ousttrue

This issue is expected to be exportable in v0.124.1.

ousttrue avatar Jul 04 '24 04:07 ousttrue