Skip to content

Commit

Permalink
Fix for Fixed Rotations with Separate Clothing Export
Browse files Browse the repository at this point in the history
When transferring an individual piece of clothing on a character and using Fixed Rotations, the rotations wouldn't be fixed.  This allows the two to work together.
  • Loading branch information
David-Vodhanel committed Jun 14, 2021
1 parent bbe842f commit 857698d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ UObject* FDazToUnrealModule::ImportFromDaz(TSharedPtr<FJsonObject> JsonObject)
// Daz Studio puts the base bone rotations in a different place than Unreal expects them.
if (CachedSettings->FixBoneRotationsOnImport && AssetType == DazAssetType::SkeletalMesh && RootBone)
{
FDazToUnrealFbx::RemoveBindPoses(Scene);
FDazToUnrealFbx::FixClusterTranformLinks(Scene, RootBone);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ void FDazToUnrealFbx::FixClusterTranformLinks(FbxScene* Scene, FbxNode* RootNode
FixClusterTranformLinks(Scene, ChildNode);
}
}
void FDazToUnrealFbx::RemoveBindPoses(FbxScene* Scene)
{
for (int32 PoseIndex = Scene->GetPoseCount() - 1; PoseIndex >= 0; --PoseIndex)
{
Scene->RemovePose(PoseIndex);
}
}

void FDazToUnrealFbx::AddWeightsToAllNodes(FbxNode* Parent)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class FDazToUnrealFbx
public:
static void RenameDuplicateBones(FbxNode* RootNode);
static void FixClusterTranformLinks(FbxScene* Scene, FbxNode* RootNode);
static void RemoveBindPoses(FbxScene* Scene);
static void AddWeightsToAllNodes(FbxNode* Parent);
private:
static void RenameDuplicateBones(FbxNode* RootNode, TMap<FString, int>& ExistingBones);
Expand Down

0 comments on commit 857698d

Please sign in to comment.