animator
Port of figure/animator.js: phase-synced locomotion blends, one-shot starts, stops, turns and jumps, idle variations, even spine, upright posture, relaxed hands, look toward the camera, arm clearance, lean into turns and two-bone foot IK on the ground. Used by the Wanderer compon…
animator
Port of figure/animator.js: phase-synced locomotion blends, one-shot starts, stops, turns and jumps, idle variations, even spine, upright posture, relaxed hands, look toward the camera, arm clearance, lean into turns and two-bone foot IK on the ground. Used by the Wanderer component.
Ported from blendi/painted-valley on Patch (MIT).
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
wrap(a: number) → number
| arg | type | description |
|---|---|---|
| a | number |
applyPosture(sk: Skel, b: { [string]: number }, fix: { spine: number, clavicle: number }?) → void
| arg | type | description |
|---|---|---|
| sk | Skel | |
| b | { [string]: number } | |
| fix | { spine: number, clavicle: number }? |
analyze(man: Man) → Shared
| arg | type | description |
|---|---|---|
| man | Man |
shouldersForward(fix: { spine: number, clavicle: number }?) → number
Shoulders' forward offset from the ankles in the standing idle (m, + = in front).
| arg | type | description |
|---|---|---|
| fix | { spine: number, clavicle: number }? |
new(man: Man) → Animator
| arg | type | description |
|---|---|---|
| man | Man |
feetAt(self: Animator, name: string, u: number) → void
Feet (relative to root) of clip `name` at normalized time u.
| arg | type | description |
|---|---|---|
| self | Animator | |
| name | string | |
| u | number |
currentFeet(self: Animator) → void
Where he is now: feet relative to the root bone, in character space.
| arg | type | description |
|---|---|---|
| self | Animator |
match(self: Animator, name: string, feet: { vector }, from: number?, to: number?) → number
The normalized time in `name` (between from and to) whose feet best match `feet`.
| arg | type | description |
|---|---|---|
| self | Animator | |
| name | string | |
| feet | { vector } | |
| from | number? | |
| to | number? |
matchPhase(self: Animator, name: string, feet: { vector }) → number
The gait phase whose feet best match `feet`, for clip `name` (a loop).
| arg | type | description |
|---|---|---|
| self | Animator | |
| name | string | |
| feet | { vector } |
enter(self: Animator, state: State, fade: number?) → State
A state returns, each frame, the clips it plays: { clip, time, w }, weights summing to 1.
| arg | type | description |
|---|---|---|
| self | Animator | |
| state | State | |
| fade | number? |
locoState(self: Animator, opts: { strafe: boolean }) → State
The locomotion blend, turning to face his way or strafing.
| arg | type | description |
|---|---|---|
| self | Animator | |
| opts | { strafe: boolean } |
sample(ctx: any, dt: number) → void
while it fades out under a stop or turn it keeps the speed it last had: the stop's first frame reports speed 0, which turned the fading run into idle for a frame (the knee snapped straight)
| arg | type | description |
|---|---|---|
| ctx | any | |
| dt | number |
sampleLoco(self: Animator, ctx: any, dt: number, advance: boolean?) → void
the gait: phase advanced by distance over stride, so feet stay planted at any mix
| arg | type | description |
|---|---|---|
| self | Animator | |
| ctx | any | |
| dt | number | |
| advance | boolean? |
add(clip: string, w: number, synced: boolean?) → void
| arg | type | description |
|---|---|---|
| clip | string | |
| w | number | |
| synced | boolean? |
dirBlend(self: Animator, ring: { { any } }, angle: number, w: number, add: (string, number, boolean?) → void
weights along a ring of directions {angle deg, clip}; adds w to the two either side of angle
| arg | type | description |
|---|---|---|
| self | Animator | |
| ring | { { any } } | |
| angle | number | |
| w | number | |
| add | (string, number, boolean? |
oneShot(self: Animator, kind: string, clip: string, opts: any?) → State
A one-shot clip from normalized time `from`, at `rate`. Root motion is read by the player.
| arg | type | description |
|---|---|---|
| self | Animator | |
| kind | string | |
| clip | string | |
| opts | any? |
sample(_ctx: any, dt: number) → void
| arg | type | description |
|---|---|---|
| _ctx | any | |
| dt | number |
update(self: Animator, dt: number, ctx: any) → void
| arg | type | description |
|---|---|---|
| self | Animator | |
| dt | number | |
| ctx | any |
evenSpine(self: Animator) → void
Spreads the spine's bend evenly over its three joints. MakeHuman's spine joints sit low and close together with a long chest above them, so a bend the clips put mostly in one joint (Idle_Tired's hands-on-knees) read as a straight lower back kinking into a bent upper back. The chest ends where the clip put it; only the curve between hips and chest changes.
| arg | type | description |
|---|---|---|
| self | Animator |
armClearance(self: Animator, dt: number) → void
Elbows stay clear of his sides: each elbow is kept at least 86% of the shoulder joints' half width out from his centre line (sideways, in his own frame), by lifting the upper arm out.
| arg | type | description |
|---|---|---|
| self | Animator | |
| dt | number |
loc(i: number) → vector
| arg | type | description |
|---|---|---|
| i | number |
relaxHands(self: Animator, speed: number, weight: number?) → void
Relaxed hands: UAL's walk and idle clench fists, anymove's clips carry no fingers at all. Every finger goes to a curl between flat (the rest pose) and the idle's fist: loose when standing and walking, firmer as he runs. The anymove page's clips keep that page's hands, as read from it (hands-anymove.json), in proportion to their weight in the mix.
| arg | type | description |
|---|---|---|
| self | Animator | |
| speed | number | |
| weight | number? |
lookToward(self: Animator, dt: number, dirWorld: vector, weight: number) → void
Head and neck turn toward where the camera looks (within reach), easing in and out.
| arg | type | description |
|---|---|---|
| self | Animator | |
| dt | number | |
| dirWorld | vector | |
| weight | number |
uprightTrunk(self: Animator, dt: number, speed: number, weight: number?) → void
Keeps his trunk about as upright as a person's at that speed (a few degrees walking, about 11 running, 14 sprinting): on this body the run clips lean 23-29 degrees and round the shoulders (blendi: shoulders too far forward while running). Measured each frame, eased.
| arg | type | description |
|---|---|---|
| self | Animator | |
| dt | number | |
| speed | number | |
| weight | number? |
leanInto(self: Animator, dt: number, turnRate: number, speed: number, forwardAccel: number) → void
| arg | type | description |
|---|---|---|
| self | Animator | |
| dt | number | |
| turnRate | number | |
| speed | number | |
| forwardAccel | number |
legIK(self: Animator, side: string, delta: vector) → void
Two-bone IK: moves the ankle of `side` by `delta` (world), knee bending in its own plane.
| arg | type | description |
|---|---|---|
| self | Animator | |
| side | string | |
| delta | vector |
placeFeet(self: Animator, dt: number, ground: (number, number, number) → void
Feet on the ground: `ground(x, z, fromY)` returns { y, normal } or nil. `rootY` is the height the clips' flat floor sits at (his visual root). Lowers the hips for the lower foot, bends the other leg, and tilts planted feet to the slope.
| arg | type | description |
|---|---|---|
| self | Animator | |
| dt | number | |
| ground | (number, number, number |
Part = { clip: string, w: number, time: number, synced: boolean? }State = {Animator = typeof(setmetatable({} :: { [string]: any }, Animator))Port of figure/animator.jsSub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.