When importing an fbx animation some curves/tangents are not imported properly. This seems related to the code from Engine/Source/Editor/MovieSceneTools/Private
/MovieSceneToolHelpers.cpp#1267-1290. In the code we can see that the ArriveTangent and LeaveTangent are divided by a time offset. Removing this division fixes the issue. I was wondering if there was a reason for this code and if it would create other issues to remove it.
for (auto SourceIt = Source.GetKeyHandleIterator(); SourceIt; ++SourceIt)
{
FRichCurveKey &Key = Source.GetKey(*SourceIt);
float ArriveTangent = Key.ArriveTangent;
FKeyHandle PrevKeyHandle = Source.GetPreviousKey(*SourceIt);
if (Source.IsKeyHandleValid(PrevKeyHandle))
{
FRichCurveKey &PrevKey = Source.GetKey(PrevKeyHandle);
ArriveTangent = ArriveTangent / (Key.Time - PrevKey.Time);
}
float LeaveTangent = Key.LeaveTangent;
FKeyHandle NextKeyHandle = Source.GetNextKey(*SourceIt);
if (Source.IsKeyHandleValid(NextKeyHandle))
{
FRichCurveKey &NextKey = Source.GetKey(NextKeyHandle);
LeaveTangent = LeaveTangent / (NextKey.Time - Key.Time);
}
FFrameNumber KeyTime = (Key.Time * FrameRate).RoundToFrame();
MovieSceneToolHelpers::SetOrAddKey(ChannelData, KeyTime, Key.Value, ArriveTangent, LeaveTangent,
Key.InterpMode, Key.TangentMode, FrameRate, Key.TangentWeightMode,
Key.ArriveTangentWeight, Key.LeaveTangentWeight);
}
Please note the animated track in the attached example is different from the screenshots below.
Issue (original code)
[Image Removed]
Expected result
[Image Removed]
[Attachment Removed]