AssImp.Net and Unity

Hey there,
I’m trying to get AssImp.Net working within Unity3d (pro). The end goal is the ability to import an IFC model into a scene. So I grabbed a copy of the source from the svn trunk. I had to comment out references to GetHRForLastWin32Error in AssimpLibrary.cs as it’s not supported in Mono. I then recompiled against Mono 3.5 to get around an issue with the use of System.Type.op_Equality. Thereafter I dropped Assimp.dll and AssimpNet.dll into the unity/assets/plugins/ directory. I ran into more problems here with “Object reference not set to an instance of an object” within the dll so after some plodding about the forums found I should put the dll in the project root.

Having gotten past all of this I’m now getting “The requested feature is not implemented” for “Assimp.InternalInterop.ReadInline[AiScene] (System.Void* pSrc)”. This particular method throws a not implemented exception but is supposed to be replaced in IL using Mono.Cecil which is referenced in AssimpNet.Interop.Generator. I’ve recompiled the generator and mono.cecil against Mono 3.5. I don’t know what to do with the resulting executable.

tl:dr Have any of you successfully read an IFC file through unity or gotten the assimp.net wrapper working? Judging by some random posts here and there some people seem to have had a far easier time than I’m having so I’m wondering if I may have missed a big step. Something along the lines of “this older version works out of the box”. Yeah, something of that ilk would be appreciated.

Stephen

I believe some folks got it working by compiling Assimp.NET against .NET 3.5 as opposed to Mono 3.5. The original DLL wasn’t written for Mono explicitly so .NET should, at the very least, give you something moderately more functional. You’ll still get NotImplementExceptions for the Win32Error bits though - which just obfuscates the more useful error messages.

Thanks. I found an older version that worked out of the box :wink: Version 3.0 of the Assimp.Net library seems to work fine. I can import the model to an Assimp.Scene object. I’m now looking at what’s involved in using/drawing that object within Unity.

Stephen

Anyone here finished implementing Assimp(.net) in Unity3D (pro)? Would love to get my hands on such a project / asset…

1 Like

Anyone?