when exporting (our own exporter using AutoDesk FBX SDK)
to a .FBX format, texture UV’s seems to be fine (checking in Maya), but
when exporting to .OBJ file, no texture UV’s are added to the file.
any special flags need to be raised or any special method have to be used in
order to see UV mapping of an OBJ file ?
No, there is no special flag to set when exporting Obj’s. The Uv’s are included automatically. You can verify this by opening your OBJ file in a text editor and look for something like the following (the following example shows the UV’s for a simple cube saved in an obj):
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.625000 0.250000
vt 0.375000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.750000
vt 0.625000 0.750000
vt 0.375000 1.000000
vt 0.625000 1.000000
vt 0.875000 0.000000
vt 0.875000 0.250000
vt 0.125000 0.000000
vt 0.125000 0.250000
VT in this case means Vertex Texture. As long as you have this in your file, you will have Uv’s with your OBJ, and in my experience I’ve never had to export in a special way to get them.
thanks for the quick reply. now the plot thickens…
when I export from our app to the fbx format - everything looks fine in maya - geometry has it’s UV map. When I try exporting to .Obj - no UV’s in maya. both processes use the same layers and scene objects, just the file extension is different. o.k, so I tried a workaround : i’m filling the KFbxScene with our data - vertices, UV’s, texture layers etc’, saving to .fbx, loading the .fbx file to the KFbxScene object with your “import” method and saving this scene with an .Obj extension - and this creates - miraculously - a correct .Obj file with all UV data in.
naturally, this workaround is not something i’d like to keep in my code, so, do you have any clue on the reason for this failure to save .Obj ? do you have a code that fills a simple geometry and exports it, so i can implant this code and build from there ?
hello again UdiBarak,
Have a look at the ExportScene2 sample that comes with the SDK and simply change the following line: