Pose Search Curve Channel Incorrect Search Results

I’m running a C++ implementation of Pose Search, similar to how GAS is running pose search. Though, when I run the pose search it’s always choosing the incorrect pose when I use a Curve Channel (works perfectly fine if I use bone positions). I noticed in the rewind debugger details that the curve value being matched seemed to be increasing with the cost rather than just using the actual curve value.

I’m kind of stuck here as for some reason the GAS blueprint implementation doesn’t log in the rewind debugger so I can’t compare.

Any help would be greatly appreciated.

[Attachment Removed]

Steps to Reproduce

  • Create Pose Search Schema with Skeletal mesh assigned and a curve channel with details as in attachment.
  • Create a Pose Search Database using the schema with details as in attachment.
  • Run Pose search between 2 animations that have the curve value similar to the attachment using the following PoseSearchLibrary function:
UFUNCTION(BlueprintPure, Category = "Animation|Pose Search|Experimental", meta = (BlueprintThreadSafe, Keywords = "PoseMatch"))
static UE_API void MotionMatch(
    UAnimInstance* AnimInstance,
    TArray<UObject*> AssetsToSearch,
    const FName PoseHistoryName,
    const FPoseSearchContinuingProperties ContinuingProperties,
    const FPoseSearchFutureProperties Future,
    FPoseSearchBlueprintResult& Result);

  • Capture with rewind debugger and find Pose Search trace and look at rewind debugger details.
    • Draw Query, Draw Trajectory, Draw History = true
  • See Curve value reporting values out of the curves range.
    [Attachment Removed]

did you add the curve to the pose history node (FAnimNode_PoseSearchHistoryCollector_Base::CollectedCurves)?

Unfortunately prior CL 50341185 we didn’t log warnings for missing curves as we do for missing bones. Sorry!

If you still see problems, try playing with UPoseSearchFeatureChannel_Curve::InputQueryPose, by setting it to UseCharacterPose, that would force generating a query with the curve value from the pose (stored in the pose history collector node). The default value UseContinuingPose will try to reuse the continuing pose (previously playing animation pose integrated to the current frame time) if it’s valid, that could not be the value you’re expecting to see.

Other places to look at if you feel investigating with a debugger attached are:

  • UPoseSearchFeatureChannel_Curve::BuildQuery where CurveValue = SearchContext.GetSampleCurveValue(SampleTimeOffset, CurveName, SampleRole); should be the curve value you would expect from the playing animation (from the previous frame).
  • UPoseSearchFeatureChannel_Curve::IndexAsset where Indexer.GetSampleCurveValue(CurveValue, SampleTimeOffset, SampleIdx, CurveName, SampleRole); returns the CurveValue for each SampleIdx for the animation Indexer.AssetSamplers.AnimationAssetSamplers.AnimationAssetSamplers[0]->AnimationAssetPtr

Or you can use the PoseSearchDatabase editor “Data Details” tab to explore and validate the poses feature data are the one you’re expecting [Image Removed]

[Attachment Removed]