After we have imported a mocap animation we usually have to edit it. There are many reasons for this: the mocap data is faulty, it doesn't fit the target character, it doesn't quite do what we want, etc. The BVH and FBX retargeter had some tools for this, but they were quite clumsy and incomplete. The natural way to edit animations in a non-destructive way would be to use animation layers, but I didn't think Blender had those. However, Alessandro pointed out that Blender always have had animation layers, but they are hidden inside the NLA editor and a bit inconvenient to use. So I decided to replace the old edit tools with animation layers, taking inspiration from this video.
Here we have imported a walk animation from ACCAD. A common problem with retargeting such files is that the collar bones tend to slope. To fix this, we add a new animation layer by pressing the plus button in the Animation Layers panel.This creates two animation layers: the base layer which is the original animation, and a second layer where we can modify the animation.Behind the scenes we have converted the original animation to an NLA track, and added a new empy animation on top of that. The NLA tracks can be disabled, but the last layer is always the current action.If we now add keyframes to the collar and shoulder bones at one frame, the animation is modified at all frames.The total animation now consists of an action and a number of NLA tracks. If we need it to be a single action, e.g. in order to export it to games, we can use the Bake Animation Layers button.After baking animation layers, the layers list is cleared, but the animation remains the same.The tracks are gone from the NLA editor, and only a single action remains.