Repository navigation
Retarget
Retargeting moves an animation made for one skeleton onto yours. FormRig matches body chains, scales the hips to your leg length, and keeps planted feet planted with leg IK. It works from the published ideas of chain-based retargeters; the code is FormRig's own.
| Source | Notes |
|---|---|
| Library | six trimmed 100STYLE clips (CC BY 4.0, Ian Mason) and five CMU motion capture trials (walk, run, jump, chicken dance, wave) |
| A clip already in the document | for example one you imported before |
| A file | FBX (animation-only files are accepted), BVH, or an ASF with its AMC. In the browser the chosen file is uploaded to <data>/imports/ through POST /api/files/store?kind=motion (2 GB cap); the desktop app reads it in place |
CMU data is read at 120 fps and resampled to 30. Lengths are converted to metres, the clip starts at the origin, and its lowest foot is put on the floor.
Every length in a retarget report (foot slide, pelvis drop and offsets, hand error, contact thresholds, ground speed in metres per second) uses the document's units, set in the Check tab (see Check); the old guess from the leg length is gone for the target. The unit of the source is the document unit when the source clip comes from the same document or its leg length equals the target's, otherwise it is still guessed from the source's leg length, because a BVH carries no unit. A Fox in centimetres reads a Walk pelvis drop of 62.6 mm; with the unit wrongly set to millimetres by hand it reads 6.3.
Open Retarget in the clip strip. Choose a source (or several files for a batch, which is one undo step), set the options and press Retarget. The new clip is selected and plays. Options are remembered.
| Option | Choices |
|---|---|
| Root motion | keep, remove (in place) or extract (the travel moves to a root joint above the hips when there is one, otherwise it is stored beside the clip) |
| Feet | plant (default) or free |
| Pose | the reference pose of both rigs for the arc between rest directions: as is, T, or 45 degree A |
| Scale | automatic (target over source thigh plus shin length), or a number |
| Foot contact | Basic (default), Steady (a foot plants below a speed limit and lets go only above one and a half times it, so a steady foot never flickers between planted and free) or Animal (the four-legged detector on every leg, see below) |
| Ground speed | Default (nothing sent), Auto or Value in metres per second: forward travel added to a clip made in place, see Four-legged rigs |
| Hands | Off (default) or Reach, with a Hand blend from 0 to 1 (default 1) |
| Twist joints | Auto (default) or Off: unmapped joints between the main joints of a limb get their share of the limb's twist |
| Four-legged | Auto (default) or Off: a skeleton with no biped legs plants its front and hind legs |
| Stride | Off (default) or On with Length, Spread, Side, Blend and Move hips |
| Orient warp | Off (default) or On with Yaw (-90 to 90 degrees), Blend (default 1) and Spine (default 0.5) |
| Pelvis limit | Off (default) or On with Vertical (0.11 leg lengths), Speed (0.17 leg lengths per second), Stretch (0.03) and Release (6 frames) |
Plain clip import (Import clip in the strip, anim.import) uses the same retargeter with foot planting; its plant argument is on by default, and plant: false keeps the plain joint transfer. It also falls back to the joint transfer when the skeleton cannot be chained (a fox, say). The reply names the method used and carries the foot slide stats. On the library walk onto Lola the worst stance slide went from 42.6 mm to 0.0 mm.
- Chains (spine, neck, head, jaw, arms with shoulder, legs with toes, eyes, five fingers per hand, tail) are derived from the joint map of Convert on your rig and from the source's canonical names.
- Each mapped joint takes the source's world rotation change, adjusted for the difference between the two rest poses (the retarget pose arc) and for facing. Unmapped joints between anchors share the neighbours' rotation by rest length.
- Hips: horizontal travel is scaled by the leg length ratio; hips height is your rest ankle height plus the scaled source height above the clip's 2nd percentile ankle height. There is no unit assumption (BVH in centimetres works).
- Feet: for each leg, stance phases are found (low ankle, slow horizontal speed), the foot is locked at the mean horizontal position of the stance, and a two-bone IK solves the leg with the pole taken from the FK knee. If the leg cannot reach, the pelvis drops. Toe phases lock the toe for heel-off.
The status line after a run shows the mean foot slide in millimetres for the source, before planting and after (one line per leg on a four-legged rig), the number of plants, the ground speed added, the hand goal error, the pelvis drop with its stretch share and released frames, the orient warp applied and limited frames, the twist joints that were fed and their error in degrees, the legs planted and the stride factor. After is zero on detected stances by construction; it proves the lock, while the visible gain is in floor contact.
Many rigs carry extra joints along the upper arm, forearm, thigh and shin (a forearm_twist, say) that the source clip does not know. With Twist joints on Auto, the legs and arms are solved on their main joints only. Afterwards the twist of each segment is shared out over the unmapped joints on the path between the two main joints, and over children named like twist, by their rest position along the segment: the upper joints get most of the turn at the top of the segment and the lower ones at the far end. Turns of more than half a revolution are kept as turns and never take the short way round. A rig without such joints is unchanged. The result card lists each limb segment with its joints and a rest length check in millimetres.
With Four-legged on Auto, a skeleton that has no biped legs (a fox, a horse) plants its front and hind legs, using the legs the limb reader found. A hind leg of four joints uses the three bone solver of Advanced limbs, so the hock bends with the stifle. Each paw has its own floor, so one high paw does not lift the others. The status line gives the slide per leg (left front, left hind, right front, right hind; a leg with no stance reads zero). A plain import of a fox goes through the chain retargeter instead of the joint transfer. When the names of the two rigs do not agree, the front legs, hind legs, spine, neck, head and tail are matched by structure: left and right from the forward direction, front and hind from where the leg roots sit.
The legs of a four-legged skeleton always use the animal detector (Foot contact Animal forces it for every leg). It sets a floor for the clip and one for each foot, scales its speed and height limits by the leg length, keeps a stance until the foot passes one and a half times the limit, and drops stances shorter than the larger of 2 frames and 0.04 seconds. A skeleton with no toe joint under the wrist (a fox) uses a virtual paw point 0.45 of the forearm length beyond the wrist. The result card lists, per leg, the stance count, duty, shortest and median stance and how many were flagged short.
Most mocap clips are made in place (the treadmill clips of the library, say). For a four-legged target, Ground speed Auto adds forward travel when the source hips move less than 10 percent of a leg length: the speed is searched for the most stance coverage. Value sets metres per second yourself. Default sends nothing, so a biped keeps its old behaviour; agents pass ground_speed as a number or auto. The Fox Walk gets 7 stances with no slide on planted frames and the Run 5.
Fox stance duty. A real animal clip does not slide the foot at the treadmill speed during stance, so the speed limit alone rejected most stance frames (Fox left hind moves back at 73 down to 4 cm per second in stance). The detector now also accepts a frame as stance when the paw is within 1.6 times the height limit and moves backward against the body by more than 15 percent of the ground speed, and a hind leg with a toe joint uses the toe as the paw point. Duty, Walk (right front, left front, left hind, right hind, mean): 0.14, 0.27, 0.27, 0.41 (mean 0.27) before, 0.636, 0.591, 0.455, 0.500 (mean 0.55) now. Run: 0.06, 0.06, 0.06, 0.14 before, 0.333, 0.361, 0.333, 0.333 now. Slide after planting is 0.0 on every leg. The automatic ground speed for the Fox moves from 1.011 to 0.880 m/s on the Walk and from 1.811 to 1.024 on the Run. The Horse gait is unchanged except that the pelvis drop reads 110.6 mm instead of 108.0.
Hands Reach solves each arm with two bone IK so the hand lands where the source hand was, taken relative to the source upper arm and scaled by the arm length ratio. Hand blend 1 uses the IK pose, 0 keeps the transferred pose. The status line shows the worst frame error from the plain transfer to the IK result in millimetres.
Orient warp turns the pelvis and legs about the vertical through the pelvis by Yaw degrees while planted feet stay fixed, so a walk can head along a new line. The yaw is cut per frame so every planted leg stays within its reach. Spine sets how much of the turn the upper body gives back: 0 turns the whole body, 1 keeps the chest facing the source heading, and the share fades in along the spine. Blend mixes the warp in. The status line reports the yaw applied and any frames it was limited.
Without it the pelvis follows the foot plants as it always did. Pelvis limit clamps the pelvis offset to Vertical leg lengths and its speed to Speed leg lengths per second, with critical damping. What the pelvis cannot take is spread over the legs as a uniform stretch up to Stretch (3 percent). Beyond that the foot is let go and blended back to the source over Release frames. The status line gives the drop, the stretch share and the released frames.
A BVH written by FormRig from a four-legged skeleton and clip imports again as a retarget source and retargets onto a different quadruped (a Fox clip onto the Horse). The BVH writer now keeps the world aligned rest, so zero channels equal the rest pose and the legs can be found by structure.
The CMU upper neck joint is no longer lost. Its turn is shared with the lower neck, and the neck chain aims at the head, so the neck to head direction error on three CMU trials fell from 7.2, 12.2 and 14.6 degrees to 3.1, 2.6 and 3.2.
Stride warps the planted feet. Length scales how far the feet step forward of the hips, Spread scales the sideways gap between the feet, Side shifts them sideways in metres, and Blend mixes between the source (0) and the warped goals (1). Move hips scales the hips' travel with the length, so a planted foot stays planted and the whole stride changes by the same factor. With Move hips off, only the feet move against the body. Length 1, Spread 1, Side 0 and Blend 1 change nothing; the clip is then identical to one made without stride. If a longer stride cannot be reached, the pelvis drops, as with any unreachable plant.
The panel lists each chain with an enable toggle, start and end joint selects and a reset. Edit a chain when the automatic one is wrong (a skirt joint in a leg chain, say). Changes are stored in the document.
A line drawing of the source skeleton can be drawn over the character for comparison, at the playhead fraction of the source clip, in the source's units multiplied by the scale the run used. It is shifted so its hips sit on the retargeted hips, so only the pose differs. It follows whichever clip is playing.
- A twist share for four-legged limbs is not built.
- Fox duty is 0.55 on the Walk and 0.33 to 0.36 on the Run, which has not been compared with a reference. A Horse gait is exact (slide 0.0 mm, 6 stances). A Fox BVH onto the Horse plants 6 stances with slide 0.0 mm after, from 76.8 to 272.3 mm before (longer stances give a longer unplanted slide).
- Facing correction is by yaw only; Z up sources are not supported.
- The CMU toe joint can sit 5 to 8 cm above the floor.
- Source and target must both be Y up.
- The retarget panel's chain select labels truncate in narrow rows.