UBlendSpace::GetSamplesFromBlendInput
#include "Animation/BlendSpace.h"
Access: public
Specifiers: const
Description
Resolves which grid samples and weights apply for a given blend input position, driving the actual pose blend.
Caveats & Gotchas
- • Returns false if BlendInput falls entirely outside any valid triangulation region — always check the return value before using OutSampleDataList.
- • Passing a stale InOutCachedTriangulationIndex from a different blend space instance can return incorrect results since the cache is per-asset.
Signature
ENGINE_API bool GetSamplesFromBlendInput(const FVector &BlendInput, TArray<FBlendSampleData> & OutSampleDataList, int32& InOutCachedTriangulationIndex, bool bCombineAnimations) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| BlendInput | const FVector& | Input coordinates; X/Y/Z correspond to BlendParameters[0]/[1]/[2]. | — |
| OutSampleDataList | TArray<FBlendSampleData>& | Populated with all samples whose weight exceeds KINDA_SMALL_NUMBER for this input. | — |
| InOutCachedTriangulationIndex | int32& | Previous triangulation/segmentation index used to warm-start the search; updated on return. | — |
| bCombineAnimations | bool | If true, samples pointing at the same animation are combined into one entry. | — |
Return Type
bool Example
Resolve samples for an input C++
TArray<FBlendSampleData> SampleDataList;
int32 CachedTriangulationIndex = INDEX_NONE;
if (MyBlendSpace->GetSamplesFromBlendInput(FVector(Speed, Direction, 0.f), SampleDataList, CachedTriangulationIndex, true))
{
// SampleDataList now holds the weighted contributing samples
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?