Cast3D animation framework provides functionality for merging animations into combined complex motion. Implementation is built into MotionBlender class which is derived from Track3d class. Input animations to blend in a form of MotionGroups instances should be added to blender instance with desired weights for each motion. The value of weight should be in range of 0-1 and defines how much influence should animation group should apply to the resulting motion. The total weight of participating motions should be equal to 1.
Resulting motion is calculated by matching and mixing of each track of MotionGroup and applying to a node of corresponding type. The blending algorithm separates tracks for each node type into translation, rotation, scale (TRS) tracks bucket and applies weighted tracks in that order. The track application order could be ( but unlikely, as TRS is common) different from original motion group. In original motion group tracks are applied in the order of appearance.
There are example of advanced usage of MotionBlender in NavigationBlenderController utility class, as it makes smooth transitions between animations by blending motions with variable weights. Please, take a look at demo sample and source code for details.