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

Key miss #290

Closed
superowner opened this issue Jul 12, 2019 · 7 comments
Closed

Key miss #290

superowner opened this issue Jul 12, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@superowner
Copy link

superowner commented Jul 12, 2019

a key miss when export a vrm

KeyNotFoundException: The given key was not present in the dictionary.
UniGLTF.UnityExtensions.GetChildByName (UnityEngine.Transform self, System.String childName) (at Assets/VRM/UniGLTF/Scripts/Extensions/UnityExtensions.cs:185)
UniGLTF.UnityExtensions.GetFromPath (UnityEngine.Transform self, System.String path) (at Assets/VRM/UniGLTF/Scripts/Extensions/UnityExtensions.cs:196)
UniGLTF.AnimationExporter.GetNodeIndex (UnityEngine.Transform root, System.Collections.Generic.List1[T] nodes, System.String path) (at Assets/VRM/UniGLTF/Scripts/IO/AnimationExporter.cs:62) UniGLTF.AnimationExporter.Export (UnityEngine.AnimationClip clip, UnityEngine.Transform root, System.Collections.Generic.List1[T] nodes) (at Assets/VRM/UniGLTF/Scripts/IO/AnimationExporter.cs:144)
UniGLTF.gltfExporter.FromGameObject (UniGLTF.glTF gltf, UnityEngine.GameObject go, System.Boolean useSparseAccessorForMorphTarget) (at Assets/VRM/UniGLTF/Scripts/IO/gltfExporter.cs:305)
UniGLTF.gltfExporter.Export () (at Assets/VRM/UniGLTF/Scripts/IO/gltfExporter.cs:138)
VRM.VRMExporter._Export (UniGLTF.glTF gltf, VRM.VRMExporter exporter, UnityEngine.GameObject go) (at Assets/VRM/UniVRM/Scripts/Format/VRMExporter.cs:42)
VRM.VRMExporter.Export (UnityEngine.GameObject go) (at Assets/VRM/UniVRM/Scripts/Format/VRMExporter.cs:34)
VRM.VRMExportSettings.Export (System.String path, System.Collections.Generic.List`1[T] destroy) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:274)
VRM.VRMExportSettings.Export (System.String path) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:238)
VRM.VRMExporterWizard.OnWizardCreate () (at Assets/VRM/UniVRM/Editor/Format/VRMExporterMenu.cs:42)
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.ScriptableWizard.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/ScriptableWizard.cs:79)
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.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:129)
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)

@hiroj
Copy link
Contributor

hiroj commented Jul 17, 2019

image
Thanks for the report
Please empty AnimationController of Animator at the time of VRM export

@superowner
Copy link
Author

image
Thanks for the report
Please empty AnimationController of Animator at the time of VRM export

Hello, I find just when using "Use Experimental Export", Unity shows the error

@hiroj
Copy link
Contributor

hiroj commented Jun 1, 2020

The version has been updated so please try again with the new version.
It would be helpful if you could write the reproduction procedure.

@hiroj hiroj added the bug Something isn't working label Jun 8, 2020
@hiroj
Copy link
Contributor

hiroj commented Jun 8, 2020

If there is a problem please reopen.

@hiroj hiroj closed this as completed Jun 8, 2020
@ghost
Copy link

ghost commented Jan 7, 2021

I`m having the same problem in the version UniVRM-0.63.1_d8d9

Error description on use vrm exported with the plugin
image

Exportation
image
image
image
image

Console exportation
unknown shader VRM_USE_GLTFSHADER.
UnityEngine.Debug:LogWarningFormat(String, Object[])
VRM.VRMMaterialImporter:CreateMaterial(Int32, glTFMaterial, Boolean) (at Assets/VRM/Runtime/IO/VRMMaterialImporter.cs:51)
UniGLTF.d__49:MoveNext() (at Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs:671)
DepthFirstScheduler.CoroutineFunctor1:Execute() (at Assets/UniGLTF/Runtime/DepthFirstScheduler/Functor.cs:118) DepthFirstScheduler.Schedulable1:Execute() (at Assets/UniGLTF/Runtime/DepthFirstScheduler/Schedulable.cs:102)
DepthFirstScheduler.Schedulable`1:ExecuteAll() (at Assets/UniGLTF/Runtime/DepthFirstScheduler/Schedulable.cs:114)
UniGLTF.ImporterContext:Load() (at Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs:488)
VRM.<>c__DisplayClass1_0:b__0() (at Assets/VRM/Editor/Format/vrmAssetPostprocessor.cs:62)
UnityEditor.EditorApplication:Internal_CallDelayFunctions()

Can't add component 'Animator' to Almond_(with Sports wear)(Clone)(normalized) because such a component is already added to the game object!
UnityEngine.GameObject:AddComponent()
VRM.<>c__DisplayClass1_0:b__0(GameObject, GameObject, Dictionary2) (at Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs:86) MeshUtility.BoneNormalizer:NormalizeHierarchy(GameObject, CreateAvatarFunc) (at Assets/UniGLTF/MeshUtility/Runtime/BoneNormalizer.cs:29) MeshUtility.BoneNormalizer:Execute(GameObject, CreateAvatarFunc) (at Assets/UniGLTF/MeshUtility/Runtime/BoneNormalizer.cs:490) VRM.VRMBoneNormalizer:Execute(GameObject, Boolean) (at Assets/VRM/Runtime/SkinnedMeshUtility/VRMBoneNormalizer.cs:69) VRM.VRMEditorExporter:Export(String, GameObject, VRMMetaObject, VRMExportSettings, IReadOnlyList1, List1) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:199) VRM.VRMEditorExporter:Export(String, GameObject, VRMMetaObject, VRMExportSettings, IReadOnlyList1) (at Assets/VRM/Editor/Format/VRMEditorExporter.cs:24)
VRM.VRMExporterWizard:OnExportClicked(GameObject, VRMMetaObject, VRMExportSettings, VRMExportMeshes) (at Assets/VRM/Editor/Format/VRMExporterWizard.cs:413)
VRM.VRMExporterWizard:OnGUI() (at Assets/VRM/Editor/Format/VRMExporterWizard.cs:229)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

image

Someone know how fix it?

@Armint49
Copy link

Armint49 commented Jan 8, 2021

I too have this problem but I don't know how to fix it

@Sigvaldas
Copy link

I too have this problem but I don't know how to fix it

So in my case I had .fbx mesh which was exported out of "Blender". By default when exporting .fbx out of blender it has "add leaf bones" option enabled so when I import that .fbx into unity some of my bones have additional bone with suffix _end. I wanted to delete those bones and I did it by deselecting "Add leaf bones" in blender. After that the fbx works as expected, it doesn't have additonal bones with _end suffix. So my issue was that I never updated by .glb file. VRM format takes animation file from glb file and in my case I just had to export .glb file out of blender (after I deleted those _end bones). After that unity sees all bones properly even tho before it tried to find all bones and some of them were missing because .gld bile had _end bones while .fbx didn't. That's how I fixed it.

a key miss when export a vrm

KeyNotFoundException: The given key was not present in the dictionary. UniGLTF.UnityExtensions.GetChildByName (UnityEngine.Transform self, System.String childName) (at Assets/VRM/UniGLTF/Scripts/Extensions/UnityExtensions.cs:185) UniGLTF.UnityExtensions.GetFromPath (UnityEngine.Transform self, System.String path) (at Assets/VRM/UniGLTF/Scripts/Extensions/UnityExtensions.cs:196) UniGLTF.AnimationExporter.GetNodeIndex (UnityEngine.Transform root, System.Collections.Generic.List1[T] nodes, System.String path) (at Assets/VRM/UniGLTF/Scripts/IO/AnimationExporter.cs:62) UniGLTF.AnimationExporter.Export (UnityEngine.AnimationClip clip, UnityEngine.Transform root, System.Collections.Generic.List1[T] nodes) (at Assets/VRM/UniGLTF/Scripts/IO/AnimationExporter.cs:144) UniGLTF.gltfExporter.FromGameObject (UniGLTF.glTF gltf, UnityEngine.GameObject go, System.Boolean useSparseAccessorForMorphTarget) (at Assets/VRM/UniGLTF/Scripts/IO/gltfExporter.cs:305) UniGLTF.gltfExporter.Export () (at Assets/VRM/UniGLTF/Scripts/IO/gltfExporter.cs:138) VRM.VRMExporter._Export (UniGLTF.glTF gltf, VRM.VRMExporter exporter, UnityEngine.GameObject go) (at Assets/VRM/UniVRM/Scripts/Format/VRMExporter.cs:42) VRM.VRMExporter.Export (UnityEngine.GameObject go) (at Assets/VRM/UniVRM/Scripts/Format/VRMExporter.cs:34) VRM.VRMExportSettings.Export (System.String path, System.Collections.Generic.List`1[T] destroy) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:274) VRM.VRMExportSettings.Export (System.String path) (at Assets/VRM/UniVRM/Scripts/Format/VRMExportSettings.cs:238) VRM.VRMExporterWizard.OnWizardCreate () (at Assets/VRM/UniVRM/Editor/Format/VRMExporterMenu.cs:42) 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.ScriptableWizard.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/ScriptableWizard.cs:79) 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.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:129) 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants