Search Unity

KhronosGroup/UnityGLTF -- Imported Skinned Meshes seem to only give error, model not even showing up

Discussion in 'Scripting' started by yaakovyitzchakbenmoshe, May 21, 2019.

  1. yaakovyitzchakbenmoshe

    yaakovyitzchakbenmoshe

    Joined:
    Feb 9, 2018
    Posts:
    21
    I'm trying to use the GLTF model importer, I'm simply modifying the GTLF Uri in the examples to replace it with my own blender-made models, and when I create a simple shape, even an animating (spinning) one, there is no problem; however, when I create a skinned mesh in blender by making an Armature, then parenting the mesh to the armature by "automatic weights", then try to import the mesh, I get the following error:

    > `NullReferenceException: Object reference not set to an instance of an
    > object UnityGLTF.GLTFSceneImporter+d__69.MoveNext () (at
    > Assets/UnityGLTF/Scripts/GLTFSceneImporter.cs:1152)
    > --- End of stack trace from previous location where exception was thrown ---
    > System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.GetResult () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > UnityGLTF.GLTFSceneImporter+<_LoadScene>d__57.MoveNext () (at
    > Assets/UnityGLTF/Scripts/GLTFSceneImporter.cs:606)
    > --- End of stack trace from previous location where exception was thrown ---
    > System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.GetResult () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > UnityGLTF.GLTFSceneImporter+d__45.MoveNext () (at
    > Assets/UnityGLTF/Scripts/GLTFSceneImporter.cs:267)
    > --- End of stack trace from previous location where exception was thrown ---
    > System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.GetResult () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > UnityGLTF.GLTFComponent+d__20.MoveNext () (at
    > Assets/UnityGLTF/Scripts/GLTFComponent.cs:129)
    > --- End of stack trace from previous location where exception was thrown ---
    > System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd
    > (System.Threading.Tasks.Task task) (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.TaskAwaiter.GetResult () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > UnityGLTF.GLTFComponent+d__19.MoveNext () (at
    > Assets/UnityGLTF/Scripts/GLTFComponent.cs:51)
    > --- End of stack trace from previous location where exception was thrown ---
    > System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at
    > <23c160f925be47d7a4fd083a3a62c920>:0)
    > System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0
    > (System.Object state) (at <23c160f925be47d7a4fd083a3a62c920>:0)
    > UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at
    > C:/buildslave/unity/build/Runtime/Export/Scripting/UnitySynchronizationContext.cs:115)
    > UnityEngine.UnitySynchronizationContext:ExecuteTasks()
    >
    > `
    >
    > I see when I try opening the simple skinned animation example that
    > takes from the raw github URL
    > here:https://raw.githubusercontent.com/K...aster/2.0/RiggedSimple/glTF/RiggedSimple.gltf
    > and here
    > https://raw.githubusercontent.com/K...e-Models/master/2.0/Monster/glTF/Monster.gltf

    those both play fine, its only when importing my own blender made skinned mesh where the error shows up. I just tried it with a brand new mesh -- only has the armature parent, but still error. Any ideas ?