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;
}