This article mainly focus on some tool-tips you might encounter while doing some animation development. And I will keep updating this article from time to time.
AnimNode not evaluating your data?
If you have your own Animation Node and find it not evaluate your input data?
In your Update_AnyThread
function, be sure to call:
1 | GetEvaluateGraphExposedInputs().Execute(Context) |
Caution: This shall cost some performance!
FCSPose::ConvertBoneLocalSpace
Function
Bone hierarchy is an array-based tree. Thus if you want to convert all bone to local space, be sure to traverse from end to the beginning.
Don’t use TMap
for your own AnimNode
Well… at lease not in 4.20
Using TMap
causing crash when hitting compile button or save.
1 | // FAnimBlueprintCompilerContext::CreateEvaluationHandlerStruct |
Watch out out bone order in your EvaluateSkeletalControl_AnyThread
function.
See FCSPose<PoseType>::LocalBlendCSBoneTransforms
function. There is a Parents before Children order check in this function.
1 | template<class PoseType> |
As a result, do add following code to the end of your function:
1 | OutBoneTransforms.Sort(FCompareBoneTransformIndex()); |
How to get curve data in an Anim Sequence
?
Before Version 4.22:1
2
3
4
5
6
7
8
9
10
11
12
13
14const auto& curveData = inAnimSeq->GetCurveData();
auto curveUID = inAnimSeq->GetSkeleton()->GetUIDByName(USkeleton::AnimCurveMappingName, inCurveName);
if (curveUID == SmartName::MaxUID)
{
success = false;
return errorResult;
}
const FFloatCurve* curve = (const FFloatCurve*)curveData.GetCurveData(curveUID, ERawCurveTrackTypes::RCT_Float);
success = true;
float result = curve->Evaluate(inTime);
return result;
After Version 4.22:
1 | auto curveUID = inAnimSeq->GetSkeleton()->GetUIDByName(USkeleton::AnimCurveMappingName, inCurveName); |
AnimGraphNode Module
Your AnimGraphNode
should be placed in a Developer
or Uncooked
module. Otherwise it cause error in your dedicated server.