Second Element of TArray Changing When Passed by Ref?
So I have a FCompactPose OutPose which holds a struct variable of it's parent class FBaseCompactPose SourcePose.
In AnimNodeSequencePlayer::Evaluate_AnyThread(), I create an FBoneContainer which contains a TArray SkeletonToCompactPose, which is essentially just an array of int32 representing each bone in a skeleton.
Upon initialization, it has the correct number of bones with correct indices. This FBoneContainer is then stored in OutPose.SourcePose
Next, GetAnimationPose(FCompactPose& OutPose) is called, which then calls GetBonePose(FCompactPose& OutPose).
In GetBonePose(FCompactPose& OutPose), a new const FBoneContainer& RequiredBones is set to equal OutPose.SourcePose.GetFBoneContainer().
In this case, in a skeleton with 80 bones FCompactPoseBoneIndex and SkeletonBoneIndex should both equal 0 up to 79. When the FBoneContainer is initialized this is true. But in AnimSequence::GetBonePose(FCompactPose& OutPose), FCompactPoseBoneIndex at SkeletonBoneIndex of 1 equals a random number in the 100s, once 714, another time 652. But only the value at the index of 1, all other indices are as they should be.
This is how it's accessed:
How could this single index, which isn't even the very first index in the array, be changed but not the others?
The SourcePose variable in OutPose is not UPROPERTY(), so I thought maybe it might be getting garbage collected, but all the other values are saved and correct. Any help is appreciated!
asked Feb 08 '19 at 06:35 PM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here