assimp / assimp-net

Automatically exported from code.google.com/p/assimp-net
191 stars 82 forks source link

NullReferenceException when trying to import FBX. #30

Open ruzannakamalyan opened 8 years ago

ruzannakamalyan commented 8 years ago

Hi, I'm getting the following exception with the latest versions for both (assimpnet and assimp)

NullReferenceException: Object reference not set to an instance of an object System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:1940) System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:1873) System.String.Format (System.String format, System.Object arg0, System.Object arg1, System.Object arg2) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:1863) Assimp.Material.CreateFullyQualifiedName (System.String baseName, TextureType texType, Int32 texIndex) Assimp.MaterialProperty.get_FullyQualifiedName () Assimp.Material.AddProperty (Assimp.MaterialProperty matProp) Assimp.Material.Assimp.IMarshalable<Assimp.Material,Assimp.Unmanaged.AiMaterial>.FromNative (Assimp.Unmanaged.AiMaterial& nativeValue) Assimp.MemoryHelper.FromNativeArray[Material,AiMaterial] (IntPtr nativeArray, Int32 length, Boolean arrayOfPointers) Assimp.Scene.Assimp.IMarshalable<Assimp.Scene,Assimp.Unmanaged.AiScene>.FromNative (Assimp.Unmanaged.AiScene& nativeValue) Assimp.MemoryHelper.FromNativePointer[Scene,AiScene] (IntPtr ptr) Assimp.Scene.FromUnmanagedScene (IntPtr scenePtr) Assimp.AssimpContext.ImportFile (System.String file, PostProcessSteps postProcessFlags)

Any help is appreciated.

kewur commented 8 years ago

Having the exact same problem. Tested both FBX and DAE getting it from both.

NullReferenceException: Object reference not set to an instance of an object (wrapper stelemref) object:stelemref (object,intptr,object) System.String.Format (System.String format, System.Object arg0, System.Object arg1, System.Object arg2) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:1863) Assimp.Material.CreateFullyQualifiedName (System.String baseName, TextureType texType, Int32 texIndex) Assimp.MaterialProperty.get_FullyQualifiedName () Assimp.Material.AddProperty (Assimp.MaterialProperty matProp) Assimp.Material.Assimp.IMarshalable<Assimp.Material,Assimp.Unmanaged.AiMaterial>.FromNative (Assimp.Unmanaged.AiMaterial& nativeValue) Assimp.MemoryHelper.FromNativeArray[Material,AiMaterial] (IntPtr nativeArray, Int32 length, Boolean arrayOfPointers) Assimp.Scene.Assimp.IMarshalable<Assimp.Scene,Assimp.Unmanaged.AiScene>.FromNative (Assimp.Unmanaged.AiScene& nativeValue) Assimp.MemoryHelper.FromNativePointer[Scene,AiScene] (IntPtr ptr) Assimp.Scene.FromUnmanagedScene (IntPtr scenePtr) Assimp.AssimpContext.ImportFile (System.String file, PostProcessSteps postProcessFlags) Entities.Player.Player.Start () (at Assets/Scripts/Entities/Player/Player.cs:94)

ruzannakamalyan commented 8 years ago

@kewur , we got rid off the exception by using assimp-net version 3.0 and the latest version for assimp.

kewur commented 8 years ago

@ruzannakamalyan Thanks, that's exactly what I did but I'm using 3.2 instead.