UBlendSpace::ResetBlendSamples
#include "Animation/BlendSpace.h"
Access: public
Specifiers: const
Description
Resets a cached set of blend samples to a given normalized time, advancing each sample using sync markers where possible instead of just resetting a raw time value.
Caveats & Gotchas
- • Falls back to setting each sample's time directly to InNormalizedCurrentTime when sync markers aren't available, which can cause a visible pop if samples' animations have very different lengths.
- • bMatchSyncPhases defaults to true, which forces followers to match the leader's marker count — set it false if you want followers to only snap to their nearest valid sync position instead.
Signature
ENGINE_API void ResetBlendSamples(TArray<FBlendSampleData>& InOutSampleDataCache, float InNormalizedCurrentTime, bool bLooping, bool bMatchSyncPhases = true) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InOutSampleDataCache | TArray<FBlendSampleData>& | Sample data cache to reset. | — |
| InNormalizedCurrentTime | float | The normalized time to match when advancing samples. | — |
| bLooping | bool | If true, advance samples as a looping blend space would. | — |
| bMatchSyncPhases | bool | If true, follower samples pass the same number of markers the leader has passed to match its sync phase; otherwise they only match their next valid sync position. | true |
Return Type
void Example
Reset cache on state entry C++
// On entering a new animation state that reuses this blend space:
MyBlendSpace->ResetBlendSamples(SampleDataCache, /*InNormalizedCurrentTime=*/0.f, bLoop, /*bMatchSyncPhases=*/true); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?