diff --git a/src/fbx/Fbx2Raw.cpp b/src/fbx/Fbx2Raw.cpp index 40a2cf3..bc64020 100644 --- a/src/fbx/Fbx2Raw.cpp +++ b/src/fbx/Fbx2Raw.cpp @@ -997,6 +997,10 @@ static void ReadAnimations(RawModel& raw, FbxScene* pScene, const GltfOptions& o (float)totalSizeInBytes * 1e-6f); } } + if (animationCount > 0) { + FbxAnimStack* pAnimStack = pScene->GetSrcObject(0); + pScene->SetCurrentAnimationStack(pAnimStack); + } } static std::string FindFileLoosely( @@ -1183,6 +1187,12 @@ bool LoadFBXFile( // this is always 0.01, but let's opt for clarity. scaleFactor = FbxSystemUnit::m.GetConversionFactorFrom(FbxSystemUnit::cm); + const int animationCount = pScene->GetSrcObjectCount(); + if (animationCount > 0) { + FbxAnimStack* pAnimStack = pScene->GetSrcObject(0); + pScene->SetCurrentAnimationStack(pAnimStack); + } + ReadNodeHierarchy(raw, pScene, pScene->GetRootNode(), 0, "", -1); ReadNodeAttributes(raw, pScene, pScene->GetRootNode(), textureLocations); ReadAnimations(raw, pScene, options);