Samples Content Exporter Update

DirectX SDK (June 2010) includes the Samples Content Exporter utility for creating .sdkmesh data files using Autodesk's FBX SDK library. At the time, this utility used the 2010.2 version of the Autodesk FBX SDK which did not have support for Visual Studio 2010. Therefore, the VS 2010 project file was set up to require the VS 2008 toolset.

Attached to this blog post is an updated version that uses Autodesk FBX SDK 2011.3.1 which does support VS 2010. The VS 2010 project file no longer requires the VS 2008 toolset. This version of the utility also supports building x64 native configurations and adds a new 'exportScale' export setting.

The update is subject to the same EULA as the DirectX SDK (June 2010) release. For documentation, install the DirectX SDK, open the DirectX Software Development Kit documentation file and view the topics Samples Content Exporter and Overview of the SDK Mesh File Format.

Disclaimer: .SDKMESH has been our long-time samples runtime geometry format since the retiring of the legacy .X file format. It has a number of limitations, and we don't recommend using it as a your production solution for meshes. It is, however, very useful for samples and itself serves as an example of such file containers. The Windows 8 DirectX sample Marble Maze makes use of .SDKMESH and the code for loading and rendering them for a Windows Store app (a.k.a. Metro style apps) can be found on the Windows Samples Code Gallery. Traditional Win32 desktop code for loading and rendering an .SDKMESH can be found in the DirectX SDK (June 2010)'s DXUT library. The documentation on the format can be found here.

Remember to set the FBX_SDK environment variable to the location of the 2011.3.1 Autodesk FBX SDK installed on your system (such as "C:\Program Files\Autodesk\FBX\FbxSdk\2011.3.1"). You are free to use either the DLL or static library version of the Autodesk FBX SDK, but would recommend using the DLL version which keeps the content exporter tool itself to around 1 MB instead of being nearly 7 MB.

The Samples Content Exporter relies on the legacy D3DX9 library that is only available in the DirectX SDK. If trying to build with Visual Studio 11, be sure to read through "Where is the DirectX SDK?"

Update: This project is now hosted on GitHub and has been updated to support VS 2012 with Autodesk FBX SDK 2014.1 or later, and VS 2013 with Autodesk FBX SDK 2015.1 or later. It is available under the MIT license, and no longer makes use of the legacy DirectX SDK or D3DX9. See Samples Content Exporter (May 2015).

Related: DirectXTK now has support for loading and rendering meshes from .SDKMESH files. Also, the meshconvert sample for DirectXMesh can convert Wavefront OBJ files to .SDKMESH files.

Comments (15)

  1. JimmyG says:

    Using fbx20113_fbxsdk_win.exe and  FBX_SDK=C:Program FilesAutodeskFBXFbxSdk2011.3

    The attached has these errors in ImportFBX project under Visual Studio 2012.  Is this the correct attachment  ?

    1>  FBXImportMain.cpp

    1>FBXImportMain.cpp(222): error C2039: 'GetCurrentVersion' : is not a member of 'fbxsdk_2011_3::KFbxIO'

    1>          C:Program FilesAutodeskFBXFbxSdk2011.3includefbxfilesdk/kfbxio/kfbxio.h(57) : see declaration of 'fbxsdk_2011_3::KFbxIO'

    1>FBXImportMain.cpp(222): error C3861: 'GetCurrentVersion': identifier not found

    1>FBXImportMain.cpp(234): error C2039: 'DetectFileFormat' : is not a member of 'fbxsdk_2011_3::KFbxIOPluginRegistry'

    1>          C:Program FilesAutodeskFBXFbxSdk2011.3includefbxfilesdk/kfbxplugins/kfbxiopluginregistry.h(60) : see declaration of 'fbxsdk_2011_3::KFbxIOPluginRegistry'

    1>FBXImportMain.cpp(238): error C2039: 'SetFileFormat' : is not a member of 'fbxsdk_2011_3::KFbxImporter'

    1>          C:Program FilesAutodeskFBXFbxSdk2011.3includefbxfilesdk/kfbxio/kfbximporter.h(139) : see declaration of 'fbxsdk_2011_3::KFbxImporter'

    1>  ParseMesh.cpp

    1>ParseMesh.cpp(182): error C2039: 'MeshSmoothness' : is not a member of 'fbxsdk_2011_3::KFbxMesh'

    1>          C:Program FilesAutodeskFBXFbxSdk2011.3includefbxfilesdk/kfbxplugins/kfbxmesh.h(65) : see declaration of 'fbxsdk_2011_3::KFbxMesh'

    1>ParseMesh.cpp(182): error C2065: 'MeshSmoothness' : undeclared identifier

    1>ParseMesh.cpp(182): error C2146: syntax error : missing ';' before identifier 'Smoothness'

    1>ParseMesh.cpp(182): error C2065: 'Smoothness' : undeclared identifier

    1>ParseMesh.cpp(183): error C2065: 'Smoothness' : undeclared identifier

    1>ParseMesh.cpp(183): error C2039: 'HULL' : is not a member of 'fbxsdk_2011_3::KFbxMesh'

    1>          C:Program FilesAutodeskFBXFbxSdk2011.3includefbxfilesdk/kfbxplugins/kfbxmesh.h(65) : see declaration of 'fbxsdk_2011_3::KFbxMesh'

    1>ParseMesh.cpp(183): error C2065: 'HULL' : undeclared identifier

    1>  ParseMisc.cpp

    1>ParseMisc.cpp(170): error C2440: 'type cast' : cannot convert from 'fbxsdk_2011_3::fbxDouble3' to 'DOUBLE *'

    1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

  2. JimmyG says:

    Looks like the attached is still for  FBXFILESDK_NAMESPACE  fbxsdk_20102


    /** Get the FBX version number for this version of the FBX SDK.

         * FBX version numbers start at 5.0.0.

         * param pMajor        Version major number.

         * param pMinor        Version minor number.

         * param pRevision     Version revision number.

             * remarks This function is deprecated, use KFbxSdkManager::GetFileFormatVersion instead.


       K_DEPRECATED static void GetCurrentVersion(int& pMajor, int& pMinor, int& pRevision);

  3. BTW, someone commented on one of the forums asking why Microsoft didn't include an EXE version of the Samples Content Exporter in the DirectX SDK. At the time that we released the DirectX SDK, the Autodesk FBX SDK only offered the 'static library' version and not the 'DLL' version. The static library version makes for a very large executable (6X larger) and we were concerned about potential security servicing. The DLL version is much better all around.

  4. Yu Haiyang says:

    I want the newer edition  for fbx 2013.3.1,where can i find it?

  5. We have not updated the samples content exporter for the latest FBX. Autodesk is making numerous breaking changes, so we are holding off until this work stabilizes. You are of course welcome to modify the source for your own purposes to use 2013.x.

  6. Yu Haiyang says:

    how can I transfer a X_FILE into a sdkmesh_anim with MeshConvert?

  7. Nick Dunning says:

    I managed to get the application to convert and export my FBX model, but I am having trouble with the textures. Is there a way to force the application to create the diffuse and normal map DDS texture files? I've gone through the help menu and I couldn't find any way of doing this.

  8. @Nick – I believe you are expected to convert the textures to DDS externally to the exporter.

  9. dev says:

    Can we expect any update on this? Hasn't Autodesk FBX SDK stabilized yet? Would greatly appreciate new, updated version of this exporter.

  10. @dev – It will take a pretty significant rewrite to update to the 2013 era Autodesk FBX SDKs, but it is on my backlog…

  11. dev says:

    Glad to hear it's not forgotten! I will wait patiently, thanks for all the work you (and others) do to help us developing with DirectX!

  12. dev says:

    Just wanted to quickly drop this here:

    Autodesk FBX SDK 2014.1 is now released.

  13. StarsX says:

    Actually, a format with the complete functions of character animation is important to my demo producing. SDKMESH is indeed a simple way to satisfy my requirement, but it must be coupled with FBX SDK…, while FBX SDK are often updated with different APIs… I remembered once all the prefixes had been changed in the updated FBX SDK version. I just worked through the whole program and changed them manually (I swore I would never do such work again)… Glad to see the new version and thanks for your work, hoping this time all things will go smoothly, Hah.

  14. David says:

    I exported a mesh with two different UV sets from Blender using the internal FBX exporter. Reimporting the mesh into Blender works fine. However, if I convert the mesh into SDKMESH format using the provided tool the first UV channel (texture mapping) works fine, but the second (light mapping) is warped in a very strange way. If I reorder the UV channels in Blender, it's the other way around – light mapping now works fine, but texture mapping is warped. I'm not sure whether there's an error in my code (vertex layout or anything) or in the tool. I'd be happy to provide a minimal test scene to reproduce the error. Any help is appreciated!

  15. David says:

    Weird stuff happening here… I was able to narrow the error down a bit. The FBX exporter automatically collapses UV values which are the same / very close, and each vertex has an index into the list of UV values. So far, so good. If this mapping is the same, both UV maps are imported correctly. If the mapping is different (e.g. if UV channel 0 has two triangles [vertices are already duplicated] mapped as a quad, yielding 4 values in the list of UV values, and UV channel 1 has the same two triangles mapped separately, yielding 6 values in the list of UV values), my second UV map is distorted. Some values in UV channel 1 are mixed up, and for some I have no idea where they're coming from.

Skip to main content