Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/FAnimationRuntime > API/Runtime/Engine/FAnimationRuntime/GetKeyIndicesFromTime
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Public/AnimationRuntime.h |
| Include | #include "AnimationRuntime.h" |
| Source | /Engine/Source/Runtime/Engine/Private/Animation/AnimationRuntime.cpp |
static void GetKeyIndicesFromTime
&40;
int32 & OutKeyIndex1,
int32 & OutKeyIndex2,
float & OutAlpha,
const double Time,
const int32 NumKeys,
const double SequenceLength,
double FramesPerSecond
&41;
Remarks
Get Key Indices (start/end with alpha from start) with input parameter Time, NumKeys from % from StartKeyIndex, meaning (CurrentKeyIndex(float)-StartKeyIndex)/(EndKeyIndex-StartKeyIndex) by this Start-End, it will be between 0-(NumKeys-1), not number of Pos/Rot key tracks The FramesPerSecond parameter must be the sample rate of the animation data, for example 30. If the FramesPerSecond parameter is set to 0 or negative, it will automatically calculate the FramesPerSecond based on the sequence length and number of frames. The reason why you can provide a FramesPerSecond value is because this can be slightly more accurate than calculating it, in case super high precision is needed.