Merge pull request #839 from rickyviking/fbxAxisSystem
Fbx Plugin: added plugin option to set the target axis system.
This commit is contained in:
commit
dfc092c894
@ -572,7 +572,34 @@ osgDB::ReaderWriter::WriteResult ReaderWriterFBX::writeNode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
FbxExporter* lExporter = FbxExporter::Create(pSdkManager, "");
|
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
|
// Ensure the directory exists or else the FBX SDK will fail
|
||||||
if (!osgDB::makeDirectoryForFile(filename)) {
|
if (!osgDB::makeDirectoryForFile(filename)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user