Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

export fbx

Anonymous

export fbx

Anonymous
Not applicable

I need to use fbxsdk to export my 3D model to FBX file format. What should I do?

thanks for answer.

0 Likes
Reply
Accepted solutions (1)
2,112 Views
5 Replies
Replies (5)

regalir
Autodesk
Autodesk

Base on the very little information you posted, I would say that, most likely, you need to code a translation unit that :

 

  1. read your 3D data model
  2. convert each data from your system to FBX objects
  3. save the in memory FbxScene (and all its content) to an FBX file

Maybe you can look at the samples code that ships with the FBX SDK to get you started.

If you are "lucky" enough that your 3D Model is in a (Collada DAE), (Alias Wavefrom OBJ) or a DXF file format, then the FBX SDK can directly convert it and you can probably just use the ConvertScene sample.

Anonymous
Not applicable

my 3d model is in a bvh file format,I want to ask how can i read ths animation stack in my file.thanks~

0 Likes

Anonymous
Not applicable

I want to conversion of BVH format to FBX format,what should i do for this.

0 Likes

regalir
Autodesk
Autodesk
Accepted solution

Ah! This is an easy one. The FBX SDK can read BVH files (starting with the FBX SDK 2014.0 😊)

 

All you have to do is read the BVH file and save it as an FBX. I suggest you just grab one of the samples so you have access to the Common/Common.h file that defines the LoadScene/SaveScene functions. You can then just strip the main() and replace it with the basic calls below:

 

#include "../Common/Common.h"

int main(int argc, char** argv)
{    
    FbxManager* lSdkManager = NULL;
    FbxScene* lScene = NULL;
    bool lResult = true;

    // Prepare the FBX SDK.
    //The first thing to do is to create the FBX Manager which is the object allocator for almost all the
    // classes in the SDK
    lSdkManager = FbxManager::Create();
    if (!lSdkManager)
    {
        FBXSDK_printf("Error: Unable to create FBX Manager!\n");
        exit(1);
    }

    //Create an IOSettings object. This object holds all import/export settings.
    FbxIOSettings* ios = FbxIOSettings::Create(lSdkManager, IOSROOT);
    lSdkManager->SetIOSettings(ios);

    //Create an FBX scene. This object holds most objects imported/exported from/to files.
    lScene = FbxScene::Create(lSdkManager, "My Scene");
    if (!lScene)
    {
        FBXSDK_printf("Error: Unable to create FBX scene!\n");
        exit(1);
    }

    // parse arguments
    FbxString lFilePath("");
    FbxString lOutFilePath("");

    for( int i = 1, c = argc; i < c; ++i )
    {
        if( FbxString(argv[i]) == "-test" ) continue;
        else if( lFilePath.IsEmpty() ) lFilePath = argv[i];
        else if (lOutFilePath.IsEmpty()) lOutFilePath = argv[i];
    }

    if (!lFilePath.IsEmpty())
    {
        lResult = LoadScene(lSdkManager, lScene, lFilePath.Buffer());
    }

    if (lResult && !lOutFilePath.IsEmpty())
    {	
        // the 1 as last argument means FBX ASCII. Replacing it with 0 will 
        // write an FBX Binary
        lResult = SaveScene(lSdkManager, lScene, lOutFilePath.Buffer(), 1);
    }

    // Destroy all objects created by the FBX SDK.
    DestroySdkObjects(lSdkManager, lResult);
    return 0;
}

 

 

 

0 Likes

Anonymous
Not applicable

thanks~

I finished my work

0 Likes