Hey, I've been using Assimp to convert my models to my own format so I can load them into my game, and I've come to the point where I would like to set up a UV coordinate system. I've already created a model with a texture map, but when I load it into Assimp I only get one coordinate out of aiMesh->mTextureCoords[].
The converter crashes when I try to load any UV coordinates past mTextureCoords[index[0]]. Is there a reason why Assimp might not read the UVs from a .blender file? Or maybe blender didn't save the UVs? Am I correct in assuming that mTextureCoords stores the UVs in the same locations as mVertices? I figured I just had to reuse the aiMesh->mFaces[].mIndices index to extract them. Either way, Assimp is only loading one texture coordinate.
Are you talking about multiple sets of uv coordinates or just for example reading uv coordinates for two vertices?
I think you're missing an index there, in my version of assimp mTextureCoords is a *aiVector3d[4], meaning that it's doubly indirected: once for uv set and once for the actual coordinate number.
If you're only using one set of UVs, you should have this I think:
I think I might have figured out the problem. mTextureCoords[index]->x should be a two dimensional array with a .x at the end instead of ->x.
I really wish Assimp had better documentation... would I use the index in the second pair of brackets? I will continue to experiment till I get it right.