diff --git a/src/osgPlugins/fbx/ReaderWriterFBX.cpp b/src/osgPlugins/fbx/ReaderWriterFBX.cpp index f5cd257ea..db385c410 100644 --- a/src/osgPlugins/fbx/ReaderWriterFBX.cpp +++ b/src/osgPlugins/fbx/ReaderWriterFBX.cpp @@ -572,7 +572,34 @@ osgDB::ReaderWriter::WriteResult ReaderWriterFBX::writeNode( } FbxExporter* lExporter = FbxExporter::Create(pSdkManager, ""); - pScene->GetGlobalSettings().SetAxisSystem(FbxAxisSystem::eOpenGL); + + // default axis system is openGL + FbxAxisSystem::EPreDefinedAxisSystem axisSystem = FbxAxisSystem::eOpenGL; + + // check options + if (options) + { + std::string axisOption = options->getPluginStringData("FBX-AxisSystem"); + if (!axisOption.empty()) + { + if (axisOption == "MayaZUp") + axisSystem = FbxAxisSystem::eMayaZUp; + else if (axisOption == "MayaYUp") + axisSystem = FbxAxisSystem::eMayaYUp; + else if (axisOption == "Max") + axisSystem = FbxAxisSystem::eMax; + else if (axisOption == "MotionBuilder") + axisSystem = FbxAxisSystem::eMotionBuilder; + else if (axisOption == "OpenGL") + axisSystem = FbxAxisSystem::eOpenGL; + else if (axisOption == "DirectX") + axisSystem = FbxAxisSystem::eDirectX; + else if (axisOption == "Lightwave") + axisSystem = FbxAxisSystem::eLightwave; + } + } + + pScene->GetGlobalSettings().SetAxisSystem(axisSystem); // Ensure the directory exists or else the FBX SDK will fail if (!osgDB::makeDirectoryForFile(filename)) {