Hi - We’ve run into a 100% repro crash when calling `UMotionWarpingUtilities::ExtractBoneTransformFromAnimationAtTime` when using `BonesToRemove` feature in the skeletal mesh LOD settings.
We’ve attached a 100% repro of this crash that happens on a very small repro project. As you can see in the callstack, `UMotionWarpingUtilities::ExtractBoneTransformFromAnimationAtTime` in `MotionWarpingComponent.cpp` crashes with an array index out of bounds when the AnimBlueprint’s skeleton and the SkeletalMesh’s skeleton are different but compatible.
[Image Removed]
Repro conditions:
- AnimBlueprint compiled against Skeleton A
- SkeletalMesh assigned with compatible Skeleton B
- Motion Warping notify references a bone by name for warp point extraction
Root cause analysis:
`GetPoseBoneIndexForBoneName()` (line 260 in `UMotionWarpingUtilities::ExtractBoneTransformFromAnimationAtTime`) internally calls `RefSkeleton->FindBoneIndex(BoneName)` and returns a mesh/skeleton bone index. The code then wraps this directly in `FCompactPoseBoneIndex(BoneIndex)` and uses it to index into `FCompactPose` or `FCSPose<FCompactPose>`. The compact pose only contains the bones in the required bones set - a subset of the full skeleton - so the skeleton-space index can be larger than the compact pose array, triggering an out-of-bounds access.
With compatible skeletons, the mismatch is amplified: the bone container is from Skeleton A, but the pose data is evaluated against Skeleton B’s bone layout. An index valid in one skeleton’s compact representation is meaningless in the other’s.
Expected fix (already applied locally):
Convert the mesh bone index to a compact pose index using `FBoneContainer::MakeCompactPoseIndex(FMeshPoseBoneIndex)` before indexing into the pose. This is the same pattern used elsewhere in the engine (e.g., `AnimSingleNodeInstanceProxy.cpp` line 534). An additional `INDEX_NONE` check is needed on the resulting compact index in case the bone is present in the skeleton but absent from the required bones set.
[Image Removed]
Affected file: `Engine/Plugins/Animation/MotionWarping/Source/MotionWarping/Private/MotionWarpingComponent.cpp` — `ExtractBoneTransformFromAnimationAtTime`, both the local-space and component-space code paths.
Please advise if this fix seems reasonable (since we’ve applied it as an engine mod), and please let us know if there will be a fix directly in the engine source in future versions so that we don’t need to continue to maintain this engine divergence to avoid the crash.
[Attachment Removed]