Hi Guys,
I’m trying to transform multiple bones in the same custom animation blueprint. I’m using the Transform (Modify) Bone code present in the source of the engine
void FMyClassAnimNode::EvaluateBoneTransforms(USkeletalMeshComponent* SkelComp, FCSPose<FCompactPose>& MeshBases, TArray<FBoneTransform>& OutBoneTransforms)
{
check(OutBoneTransforms.Num() == 0);
const FBoneContainer& BoneContainer = MeshBases.GetPose().GetBoneContainer();
FCompactPoseBoneIndex CompactPoseBoneToModify = BoneToModify.GetCompactPoseIndex(BoneContainer);
FTransform NewBoneTM = MeshBases.GetComponentSpaceTransform(CompactPoseBoneToModify);
FAnimationRuntime::ConvertCSTransformToBoneSpace(SkelComp, MeshBases, NewBoneTM, CompactPoseBoneToModify, RotationSpace);
FRotator Rotation = FRotator();
Rotation.Pitch = 1.0f*counter;
const FQuat BoneQuat(Rotation);
NewBoneTM.SetRotation(BoneQuat * NewBoneTM.GetRotation());
FAnimationRuntime::ConvertBoneSpaceTransformToCS(SkelComp, MeshBases, NewBoneTM, CompactPoseBoneToModify, RotationSpace);
counter++;
OutBoneTransforms.Add(FBoneTransform(BoneToModify.GetCompactPoseIndex(BoneContainer), NewBoneTM));
}
To do the additional transformation I just use BoneToModify2 that contains the reference to the another bone and replicate this code after the OutBoneTransforms.Add. But the moment I update the animation blueprint for this code it just breaks unreal… Does anyone know why? And how to fix this?
Thanks!