This is a Blender add-on for retargeting bone animations.
Inspiration came from Bilibili UP主 露伴知了'stutorial series Unlocking FBX Motion Blending. The approach of using bone constraints for motion mapping is simple and versatile.
Building on this foundation, I further researched solutions for bone axis differences and other issues, integrating them into this add-on to simplify related setup operations. I hope this approach can be further developed to benefit more independent animators/game developers struggling with the tediousness of animation creation.
After installing and enabling the add-on, you can find the add-on panel on the right side of the 3D Viewport. No functions are available when no armature object is selected.

Import a character model and an animated armature containing the motion you want to map onto the character. Here, I'm using a running animation from a UE4 skeleton.
Select the character's armature, and the right panel will display related functions. The Mapping Armature is necessarily the selected armature itself, while the Constraint Target can be any other armature in the scene.

After setting the imported running animation armature as the Constraint Target, the full add-on panel expands. The Bone Mapping Table at the bottom is the core of this add-on, used to edit the bone correspondence between the target and source, thereby achieving bone transformation mapping.
The first four buttons arranged vertically on the right are the basic add, delete, move up, and move down functions of a Blender list interface. Click the + button to create a new mapping. Establish a correspondence between the root bones (the first spine bone) of the two models, and you will see the target bone pointing diagonally upwards like the source bone.

Instead of adding blank mappings, you can also first select one or more bones in Pose Mode, then click + to batch generate mappings and automatically fill in the targets.
Now we notice that the character's orientation after motion mapping doesn't match the running posture. This is due to different bone axes between the character's armature and the UE4 armature. Therefore, additional rotation correction is needed.

Above the Bone Mapping Table, there are four horizontally arranged buttons. The first one was selected by default when editing mappings. Now click the second button to enter the Rotation Correction editing mode. You can activate rotation correction for the corresponding bone using the button on the left side of each row in the mapping table and set the offset angle. Since Blender bones typically use the Y-axis as their extension direction, in most cases, only Y-rotation correction is needed.

After mapping all the necessary bones, the character can roughly mimic the actions of the other armature.

The previous steps only copied rotation information, so the running animation happens in place. To copy the location (movement) as well, click the third button to enter the Location Mapping editing mode. Similarly, activate it for specific bones using the left-side button.

Mapping motion solely through rotation means the final position of hands and feet can be affected by bone lengths. In the previous image, you can see the character's feet aren't accurately touching the ground. To correct this, click the fourth button to enter IK Correction editing. Activate IK correction for the foot and hand bones to more accurately mimic the source armature's motion.

However, note that differences in skeleton height can affect the hand IK correction results. Applying IK doesn't always guarantee better results; it depends on the specific case.
After painstakingly setting up the correspondences and adjusting angles, you can save a preset. This allows for one-click setup when mapping the same types of armatures in the future. The operation method is straightforward and won't be elaborated here.
Besides adding, deleting, and selecting presets in the interface, you can also click the folder button on the right to open the preset folder, allowing you to save preset files elsewhere or package and share them.
The basic workflow of the add-on is the four methods described above. After trying it once, you'll find that most of the work still lies in setting up the bone correspondences. Therefore, besides creating mappings pair by pair, the add-on is exploring ways to improve mapping efficiency.
Often, when a pair of bones is mapped, their respective children also need mapping. Based on this pattern, I created a feature to quickly link children via their parents.
Select a valid mapping in the list and click Child Mapping. It will automatically check the children. If both the source and target bones have exactly one child each, it will directly create a mapping between the children. For a chain of spine bones, it can conveniently create mappings for the entire chain.
If the source and target bones have more than one child, it will generate empty mappings (with the source bone field empty) for all children of the target bone, and the rest still need to be filled in manually.
If the two bones that need mapping have similar or identical names, can't we automatically select the corresponding bone by comparing names?
Currently, the add-on uses the difflib library for direct string similarity analysis when finding similar names. In some cases, it can directly find the intended bone to map. However, since bone naming can be very diverse, the mapping results should only be considered as a reference.
If mirror bones exist for both the selected source and target bones, new mappings can be created directly through mirroring. Blender has its own method for identifying mirror bones based on names, and the add-on directly uses that interface. As long as the naming conventions aren't too unusual (don't tell me you use Chinese characters for left/right to name mirror bones...), it should generally correctly find mirror bone pairs to create mappings.
The add-on adds a layer of encapsulation over Blender's built-in animation baking, pre-setting various properties. It allows one-click baking of animations according to the appropriate frame range and automatically sets fake users.
The retargeting method essentially involves adding constraints to bones. You can also create your own Rigify bones to drive the original bones, achieving the effect where any bone can be controlled by Rigify bones. If you enable Rotation Correction, Location Copy, and IK for a mapped bone within the add-on, you can see four constraints added to that bone, all prefixed with the add-on abbreviation 'BAC'.

ROT_COPY is a Copy Rotation constraint. It is used for the most basic rotation mapping, making the rotation state of the bone consistent with the target bone in world space.
ROT_ROLL is a Transform constraint. Transform constraints can originally achieve complex effects like "object transformation drives object transformation," but here we only adjust the "Map To" minimum rotation values, using it as a simple constraint that produces a constant rotation effect. Applying this constraint after copying rotation creates a constant angular offset between the target bone and the bone itself, meeting the mapping requirements when their initial orientations differ.
LOC_COPY is a Copy Location constraint, and IK is a simple two-bone IK constraint. The effects of these two are relatively straightforward. When you become familiar with the effects of these constraints, you can go beyond the limitations of the add-on's functions and modify the constraint effects yourself.
Fixed Preview Response: Resolved the issue where the "Preview Constraints" toggle would not trigger an immediate update.
修复预览响应问题: 修复了点击“Preview Constraints”按钮无反应的问题,现在开关状态会立即生效。
This extension does not require special permissions.
I think it has the potential to be quite useful, but it would be good if there was a way to choose between world and local location within the addon settings, rather than on the constraints.
Additionally, constraints can often conflict if you're already working with an armature. This would require a completely different approach, but using drivers instead of constraints would be a nice option for some things where constraints don't necessarily play nice.
A 'bug' I found is that if you accidentally select an IK for a non-ik bone type, it will lock up blender because of the errors.
The bug has been fixed, feel free to download it again.
Very good and functional.