How can I access the final blend samples and weights of a blendspace from a custom anim node?


TLDR: Does anyone happen to know how I can access the final blendspace weights/samples from the UBlendSpace class?


Over the last few days, I’ve been attempting to make a distance-matching blendspace node. This is meant to be similar to a BlendSpaceEvaluator, but it will take in distance rather than time. The below picture shows the (nonfunctional) node I’ve made so far.
DMBSp

I’ve already made a proof of concept, the result of which is shown in the below video, and it works well, but that was without the use of a specialized node. It’s cumbersome to iterate with that approach though.

My plan is the following:

  1. From the my custom Anim Node Behavior struct (FAnimNode_BlendSpaceDistanceMatch), grab the relevant BlendSamples determined by the UBlendSpace class, which I think are those that have a weight higher than ZERO_ANIMWEIGHT_THRESH.
  2. From those samples, get the current play time using the DistanceCurve.
  3. Normalize that time based on each BlendSample’s total play length.
  4. Sum to get the weighted normalized time: WeightNormalizedTime = NormalizedTimes.[1] * BlendSample.Weight[1] + NormalizedTimes.[2] * BlendSample.Weight[2] + ... or something like that.

My current dilemma is figuring out how to get the BlendSamples and corresponding weights. From what I can tell, this information is hidden away in an FBlendSampleData struct that I can’t seem to access (unless I’m missing something).

Does anyone happen to have any suggestions?

1 Like