Thanks for the extra info. This is a reasonably common issue to run into since you can’t query bones individually and operate on them within the anim graph.
Typically, we recommend performing all of the work within a custom anim graph node that calculates the targets and performs the IK solve. Each anim graph node has access to update-to-date bone transforms for the point in the graph that it lives in via the Evaluate_AnyThread (or EvaluateSkeletalControl_AnyThread) method. For instance, you can see in FAnimNode_FootPlacement::EvaluateSkeletalControl_AnyThread how ProcessFootAlignment gets the position of the feet and performs the raycast. We then use the results later for the custom solve.
If you want to go down this route, but you still want to leverage the FBIK solve, you could do this via an IK rig rather than a control rig. You’d author the IK rig with goals on the feet, and set up the FBIK solver. Then, in your custom node, you’d get the IK Rig, set up the goals based on the information you received from the raycast, and then run the solve on the rig. FAnimNode_IKRig::Evaluate_AnyThread shows how you would se tup the goals and run the solve. (You can’t just use the FAnimNode_IKRig node on its own in this case since you’re back to the original problem where you need to get the target positions from the current frame’s transforms.)
Having said all of that, Control Rig is designed to do exactly what you want (per-bone manipulation of the pose). So there wouldn’t be an issue with implementing all of this logic within a control rig. This is the direction we’re heading in with future sample work, rather than the various animation warping nodes we’ve used previously.
Whether there’s a performance impact of the control rig approach depends on your overall setup. If you already have a control rig within the anim graph, and you’re just moving the work into the control rig, it’s not going to have much, if any, effect (even if you have a number of nodes doing the work in the control rig since the VM is much faster than the regular anim bp VM). However, if you’re adding a control rig specifically to do this work, that would have some impact on your performance (although this is somewhat better in 5.6 than it was previously).
Lastly, there is a hybrid option where you use an animation node to calculate the target locations and pass them into a control rig. The best way to do this would be via animation attributes. Animation attributes are passed around the nodes in the anim graph via the FPoseContext object that’s passed into the EvaluateAnyThread functions in the same way that the bone transforms are. You would do something like this in your custom node’s evaluate method (I haven’t tried compiling this code):
void FAnimNode_CustomNode::Evaluate_AnyThread(FPoseContext& Output)
{
// do raycast to get target positions
// ...
const UE::Anim::FAttributeId LeftFootTargetAttributeId(TEXT("LeftFootTarget"), FCompactPoseBoneIndex(0));
if (FVectorAnimationAttribute* LeftFootTargetAttribute = Output.CustomAttributes.FindOrAdd<FVectorAnimationAttribute>(LeftFootTargetAttributeId))
{
LeftFootTargetAttribute->Value = LeftFootTargetPos;
}
}
And then in your control rig, you can use the GetAnimationAttribute node to retrieve the attribute value and use that as a target for your FBIK solve.
Hopefully that gives you some options that will work for your situation.