AREA forums upgrade
Read more about the planned upgrade of our forums
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX Plug-ins Import-Export Discussions / Texture UV missing when exporting to .Obj format
IMPORTANT ANNOUNCEMENT ABOUT AREA FORUMS
  RSS 2.0 ATOM  

Texture UV missing when exporting to .Obj format
Rate this thread
 
68805
 
Permlink of this thread  
avatar
  • UdiBarak
  • Posted: 03 July 2012 02:08 AM
  • Total Posts: 2
  • Joined: 03 July 2012 12:23 AM

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 ?



Replies: 1
/img/forum/light/default_avatar.png

Hello UdiBarak,

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.

Regards,
Carlos

Author: CarlosC

Replied: 03 July 2012 08:48 AM  
avatar
  • UdiBarak
  • Posted: 04 July 2012 03:03 AM

Hi Carlos,
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 ?
thanks again,
Udi



Replies: 1
/img/forum/light/default_avatar.png

hello again UdiBarak,

Have a look at the ExportScene2 sample that comes with the SDK and simply change the following line:

lResult = SaveScene(lSdkManager, lScene, argv[1])

With

int lFormat = lSdkManager->GetIOPluginRegistry()->FindWriterIDByDescription("Alias OBJ (*.obj)");
lResult = SaveScene(lSdkManager, lScene, argv[1], lFormat);

This will write the content of the FbxScene created by the sample to an OBJ file.

Regards,
Carlos

Author: CarlosC

Replied: 04 July 2012 04:48 AM