Imported blender model and SeparateTexCoords

I’m using baked lightmaps for some scenes I’ve imported from Blender. So I set “SeparateTexCoords” to true in my Lighting material.
However, in some cases, it seems the uv sets are flipped, so that the lightmap is applied to the diffuse set and the other way around. I thought I managed to solve this by some Blender trickery (renaming the uv sets, and exporting with various sets selected), but at the end of the day, I have two different scenes that require two different set ups to work in a similar manner. And now I noticed a second problem where the wrong uv set seems to be applied.

I can’t wrap my head around what causes this and why I have to do these things to make it work. Has anyone else experienced something similar? Or know an explanation to what is happening?

Set (in blender) UV name in texture panel > Mapping > Map.

I do, but it’s not really the name that matters, right, it’s the index?
Edit: I actually don’t do this, i thought you meant the UV map window. I’ll experiment a bit with this
The thing is, I don’t use the materials or textures coming from Blender, but apply everything in the SDK. Maybe it gets confused about the order.

I set up materials in SDK too, but data about UV is stored somewhere (magically?) in the model - yesterday I made model with rebaked textures - without proper mapping SDK used wrong uv for texture.

1 Like

Thanks for the help. Sounds like a plausible cause. I will follow this workflow in the future (although I’ve in the process switched to xbuf instead).
I still seem to be having some other possibly related issues with some of my meshes, though.

I tested this a bit a few weeks ago. As in what blender imports and how. It just imports each set of UV coords as UV one , two etc… ie in the mesh data they are vertex attributes, and the order was what was important. Not the name as far as i could tell (this also matches with how opengl does vertex attributes. )

Now how UV coordinates are ordered in blender seemed consistent to me. But i didn’t try to break anything, like a add a UV coordinate out of order or something.