AreonDev / assimp-net

Managed wrapper around the assimp open asset import library
2 stars 1 forks source link

It is impossible to add diffuse texture at export #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I try to implement export to .OBJ format. My material has diffuse textures, and 
I do the following:

TextureSlot t = new TextureSlot();
t.FilePath = dst_texture_file_name;
t.TextureType = TextureType.Diffuse;
t.TextureIndex = 0;

assimp_material.TextureDiffuse = t;

After that, assimp_material.TextureDiffuse.FilePath remains null, 
assimp_material.HasTextureDiffuse continues to show false.

Expected output is 'map_Kd lenna.tga' string it resulting .OBJ file, but it is 
missing.

I use version 3.3.1 on Windows 7.

This is C++ code of assimp:

aiString s;
if(AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_DIFFUSE(0),s)) {
    mOutputMat << "map_kd " << s.data << endl;
}

Look like all is OK there. Something is wrong in C#. Thanks.

Original issue reported on code.google.com by a.merez...@gmail.com on 25 Jan 2015 at 3:00

GoogleCodeExporter commented 9 years ago
Should be fixed in r128, the well known properties on material were using fully 
qualified rather than base name when adding the properties. You could still 
have used the AddProperty API to manually add the diffuse texture though.

Original comment by nicholas.woodfield on 22 Feb 2015 at 5:21