Assimp.NET for Android/iOS

  • Vader1986

    Vader1986 - 2013-05-27

    Hey, are there any versions of Assimp.NET for Android and iOS? I was planing to use Assimp in combination with the Unity 3D Game Engine for mobile devices. The main scripting language for Unity if C# so i tried the .net version.

    I tried to build a prototype using Assimp for Android within unity by doing following steps:
    - got an Android-version of the C++ library (
    - changed some constants defining library-name in the Assimp.NET project ("Assimp32/64.dll" -> "" or sth like that)
    One problem remained: for loading libraries at runtime, the Assimp.NET project uses "kernel32"-functions. "kernel32.dll" is not available under android, though (is it?). Is there any alternative in C# to replace the three used function from kernel32.dll (LoadLibrary, FreeLibrary and GetProcAddress)?

  • Vader1986

    Vader1986 - 2013-05-27

    Okey, i'm using the code suggested here now:

    However, with the current version of Assimp.NET i'm always getting a NullReferenceException (even with the unmodified code from the repository):

    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 /Applications/buildAgent/work/b59ae78cff80e584/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.AssimpImporter.ImportFile (System.String file, PostProcessSteps postProcessFlags)
    Assimp.AssimpImporter.ImportFile (System.String file)
    ModelImport.Load (System.String file, UnityEngine.MonoBehaviour behaviour) (at Assets/Scripts/ModelImport.cs:27)
    LoaderTest.Start () (at Assets/Scripts/LoaderTest.cs:11)

    The "TextureType texType" argument from Material.CreateFullyQualifiedName() seems to have an invalid value. No idea what's going wrong at this point.

    Btw. is this the correct forum to ask questions about Assimp.NET? Didn't find any other active community for the wrapper-project.

  • Vader1986

    Vader1986 - 2013-05-29

    Anyone here who knows more about the .net version?


Log in to post a comment.