Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom IO System doesnt work when Importing from stream #45

Open
zbendefy opened this issue Sep 24, 2018 · 2 comments
Open

Custom IO System doesnt work when Importing from stream #45

zbendefy opened this issue Sep 24, 2018 · 2 comments

Comments

@zbendefy
Copy link

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.

@Starnick
Copy link

Starnick commented Oct 5, 2018

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
Copy link

Starnick commented Oct 5, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants