Unexpected offset when using attach tracks with scene root components

Hi

We noticed an inconsistency when using attach tracks, depending on whether or not the parent actor has a default scene root. This creates an unintuitive behaviour for animators.

It can be reproduced in 5.7 and 5.8.

Kind regards

Luke

[Attachment Removed]

Steps to Reproduce
Open the provided level sequence (`/Game/AttachIssue/LS_AttachIssue`) and follow the steps in the video, or

  1. Create an actor BP and add a skeletal mesh under its default scene root component
  2. Add the BP to seqeuncer
  3. Add a cube to sequencer
  4. Position the cube in the characters hand
  5. Add attach track to cube using one of the “Preserve” position options
  6. Observe the cube does not preserve its existing position
    [Attachment Removed]

Hey,

Thanks for raising this. I’ve logged an issue that you can follow here: https://issues.unrealengine.com/issue/UE-396912

If you want to look at this locally, the compensation code currently assumes the skeletal mesh is the root component and bases all transform math on sockets off of that, which is incorrect. That is handled in F3DAttachTrackEditor::AddKeyInternal when we gather the parent object here: UObject* ParentObject = GetConstraintObject(GetSequencer(), ConstraintBindingID);

Ideally, we gather the correct skeletal mesh component and then base all compensation keys off of that.

Dustin

[Attachment Removed]