assimp / assimp-net

Automatically exported from code.google.com/p/assimp-net
191 stars 82 forks source link

How can I get texture data #66

Closed huejp21 closed 3 years ago

huejp21 commented 3 years ago

how can I get byte[] of texture data from scene?

var filePath = "C:\someobject.glb" var importer = new AssimpContext(); var scene = importer.ImportFile(filePath); // scene.TextureCount == 0 this file has texture data but in scene it has no texture.

how can I get texture? I tried with 'obj', 'stl', 'fbx', 'gltf', 'glb' all cases has no texture.

kimkulling commented 3 years ago

You need to check the materials, just look for numMaterials in the scene. The you have to look for the different kind of textures which are stored there.