@@ -83,8 +83,9 @@ DzBridgeAction::DzBridgeAction(const QString& text, const QString& desc) :
8383 m_bUndoNormalMaps = true ;
8484#endif
8585
86- m_bPostProcessFbx = false ;
87- m_bRemoveDuplicateGeografts = false ;
86+ m_bPostProcessFbx = true ;
87+ m_bRemoveDuplicateGeografts = true ;
88+ m_bExperimental_FbxPostProcessing = false ;
8889}
8990
9091DzBridgeAction::~DzBridgeAction ()
@@ -4099,9 +4100,6 @@ void FindAndProcessTwistBones(FbxNode* pNode)
40994100// import process is started in target software
41004101bool DzBridgeAction::postProcessFbx (QString fbxFilePath)
41014102{
4102- // DEBUG
4103- m_bPostProcessFbx = true ;
4104-
41054103 if (m_bPostProcessFbx == false )
41064104 return false ;
41074105
@@ -4140,43 +4138,46 @@ bool DzBridgeAction::postProcessFbx(QString fbxFilePath)
41404138 }
41414139 }
41424140
4143- // Find the root bone. There should only be one bone off the scene root
4144- FbxNode* RootNode = pScene->GetRootNode ();
4145- FbxNode* RootBone = nullptr ;
4146- QString RootBoneName (" " );
4147- for (int ChildIndex = 0 ; ChildIndex < RootNode->GetChildCount (); ++ChildIndex)
4141+ if (m_bExperimental_FbxPostProcessing)
41484142 {
4149- FbxNode* ChildNode = RootNode->GetChild (ChildIndex);
4150- FbxNodeAttribute* Attr = ChildNode->GetNodeAttribute ();
4151- if (Attr && Attr->GetAttributeType () == FbxNodeAttribute::eSkeleton)
4143+ // Find the root bone. There should only be one bone off the scene root
4144+ FbxNode* RootNode = pScene->GetRootNode ();
4145+ FbxNode* RootBone = nullptr ;
4146+ QString RootBoneName (" " );
4147+ for (int ChildIndex = 0 ; ChildIndex < RootNode->GetChildCount (); ++ChildIndex)
41524148 {
4153- RootBone = ChildNode;
4154- RootBoneName = RootBone->GetName ();
4155- RootBone->SetName (" root" );
4156- Attr->SetName (" root" );
4157- break ;
4149+ FbxNode* ChildNode = RootNode->GetChild (ChildIndex);
4150+ FbxNodeAttribute* Attr = ChildNode->GetNodeAttribute ();
4151+ if (Attr && Attr->GetAttributeType () == FbxNodeAttribute::eSkeleton)
4152+ {
4153+ RootBone = ChildNode;
4154+ RootBoneName = RootBone->GetName ();
4155+ RootBone->SetName (" root" );
4156+ Attr->SetName (" root" );
4157+ break ;
4158+ }
41584159 }
4159- }
4160- // // Daz characters sometimes have additional skeletons inside the character for accesories
4161- // if (AssetType == DazAssetType::SkeletalMesh)
4162- // {
4163- // FDazToUnrealFbx::ParentAdditionalSkeletalMeshes(Scene);
4164- // }
4165- // Daz Studio puts the base bone rotations in a different place than Unreal expects them.
4166- // if (CachedSettings->FixBoneRotationsOnImport && AssetType == DazAssetType::SkeletalMesh && RootBone)
4167- // {
4168- // FDazToUnrealFbx::RemoveBindPoses(Scene);
4169- // FDazToUnrealFbx::FixClusterTranformLinks(Scene, RootBone);
4170- // }
4171- if (RootBone)
4172- {
4173- // remove pre and post rotations
4174- RemovePrePostRotations (RootBone);
4175- // FindAndProcessTwistBones(RootBone);
4176- // RemoveBindPoses(pScene);
4177- // FixClusterTranformLinks(pScene, RootBone);
4178- }
41794160
4161+ // // Daz characters sometimes have additional skeletons inside the character for accesories
4162+ // if (AssetType == DazAssetType::SkeletalMesh)
4163+ // {
4164+ // FDazToUnrealFbx::ParentAdditionalSkeletalMeshes(Scene);
4165+ // }
4166+ // Daz Studio puts the base bone rotations in a different place than Unreal expects them.
4167+ // if (CachedSettings->FixBoneRotationsOnImport && AssetType == DazAssetType::SkeletalMesh && RootBone)
4168+ // {
4169+ // FDazToUnrealFbx::RemoveBindPoses(Scene);
4170+ // FDazToUnrealFbx::FixClusterTranformLinks(Scene, RootBone);
4171+ // }
4172+ if (RootBone)
4173+ {
4174+ // remove pre and post rotations
4175+ RemovePrePostRotations (RootBone);
4176+ // FindAndProcessTwistBones(RootBone);
4177+ // RemoveBindPoses(pScene);
4178+ // FixClusterTranformLinks(pScene, RootBone);
4179+ }
4180+ }
41804181
41814182 if (openFBX->SaveScene (pScene, fbxFilePath.toLocal8Bit ().data ()) == false )
41824183 {
0 commit comments