assimp-net icon indicating copy to clipboard operation
assimp-net copied to clipboard

Custom IO System doesnt work when Importing from stream

Open zbendefy opened this issue 7 years ago • 2 comments

Hi! I was trying to load some .OBJ files from an IOStream. These obj files have attached materials in a separate file. If I'm loading the .obj files using ImportFileFromStream, I get the following error logs:

|Information| - ASSIMP - Info,  T10160: Import root directory is './'
|Error| - ASSIMP - Error, T10160: OBJ: Unable to locate material file wall.mtl

If I load the file from the disk with ImportFIle() |Information| - ASSIMP - Info, T16528: Import root directory is 'D:/Dev/GLAssets\'

I tried using a creating an IO System and setting it to the importer, but it doesnt even get called.

zbendefy avatar Sep 24 '18 14:09 zbendefy

Indeed, I am seeing the error too. I'll look into a fix

FYI, the official AssimpNet repository that I maintain is over at BitBucket (https://bitbucket.org/Starnick/assimpnet/src/master/)

Starnick avatar Oct 05 '18 14:10 Starnick

I looked into this. Using the ImportFileFromStream doesn't use the IOSystem - this isn't an oversight, the native library is like that too. If additional model files need to be loaded (like the MTL file), it is recommended to attach an IOSystem and call ImportFromFile. In that scenario, the IOSystem you supply will open a stream to both the OBJ file and the MTL file.

I'm adding some documentation to the XML comments to reflect this.

Starnick avatar Oct 05 '18 21:10 Starnick