afk.ai Auto-Rig

v1.3.6
io.github.dyoburon/afk-rig Checked 49 minutes ago Published 21 days ago

Auto-rig 3D models (GLB, glTF, FBX) with skeleton, skin weights and 170+ animations via afk.ai.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

rig_model

Auto-rig a 3D model file (.glb, .gltf with everything embedded, or .fbx; up to 200 MB) and write the rigged .glb with its animations. Takes about a minute. Returns where the file was written.

ParameterTypeDescription
path *stringthe model file (absolute, or relative to the server's working directory)
animationsall (default), none (just the rig), or animation names from list_body_types
facingwhich way the model faces, in degrees about its up axis; auto works it out
keep_arms_outbooleanhumans: keep the arms out of the body in every animation, on this computer after the download, as afk.ai/rig does (seconds to a minute)
outputstringwhere to write the rigged .glb (default: <model>.rigged.glb next to it)
typestringwhat the model is: human for anything on two legs, fox for dogs/cats/wolves, horse for hoofed animals, and so on

image_to_character

Make a rigged, animated 3D character from a picture (.png, .jpg or .webp of one character, whole; up to 20 MB): a 3D model made from the picture, rigged with every animation for its body type, written as a .glb. Takes about 2 to 3 minutes (up to 5 when the GPU is starting) and costs $0.25 of API credits, refunded if it fails. Returns where the file was written, what was charged and the credits left.

ParameterTypeDescription
path *stringthe picture (absolute, or relative to the server's working directory)
animationsall (default), none (just the rig), or animation names from list_body_types
keep_arms_outbooleanhumans: keep the arms out of the body in every animation, on this computer after the download, as afk.ai/rig does (seconds to a minute)
outputstringwhere to write the rigged .glb (default: <picture>.rigged.glb next to it)
typestringwhat the character is: human for anything on two legs, fox for dogs/cats/wolves, horse for hoofed animals, and so on

get_account

How many rigs the account can make (rigs_left: its free rigs this month, then its Lifetime API credit this month with afk.ai Lifetime, then its API credits), and its credit balance for characters.

list_body_types

The body types a model can be rigged as, and (with type) that type's animations.

ParameterTypeDescription
typestring

rig_status

A rig's status by id (rig_model waits for its rig, so this is for rigs started elsewhere).

ParameterTypeDescription
id *string

inspect_rig

Measure a rigged .glb: its bones (names, parents, positions), meshes, height, the animations with problems, worst first, each with the moment it's worst at to render (ground: % of height its lowest point goes below the rest floor or stays above it, and which bone; stretching: % of skin torn at worst; humans: frames with a forearm or hand through the body, and the deepest) and the animation controls adjust_animation takes. Flying, swimming and other animations that leave the floor on purpose are marked in_the_air and not judged against it. Runs on this computer, free: about a second, a few for…

ParameterTypeDescription
file *stringa rigged .glb (absolute, or relative to the server's working directory): one rig_model wrote, or any model on afk.ai's skeletons
animationsarrayonly these animations, each listed whether it has a problem or not
limitintegerat most this many animations with problems, worst first (default 40; the rest are named)
typestringthe body type, when it can't be told from the file (afk.ai's files say)

render_rig

Draw a rigged .glb as an image to look at: at rest, or posed at a moment of one of its animations, with its skeleton over it (blue: its left, red: its right, orange: the middle) and rulers in model units. Pinkish-red skin is the inside of the mesh showing (a tear, or a part pushed through another). Also returns every joint drawn in the image with its pixel position and, posed, how far its lowest point is from the rest floor (lowest_point_vs_floor, % of height). Runs on this computer, free.

ParameterTypeDescription
file *stringa rigged .glb (absolute, or relative to the server's working directory): one rig_model wrote, or any model on afk.ai's skeletons
animationstringpose it in this animation (inspect_rig lists them); default: at rest
focuszoom on a joint (name) or a point [x, y, z]
jointsjoints to draw (default main: no fingers or tips)
radiusnumberthe zoomed area's radius in model units (default 15% of the height)
save_tostringalso write the PNG here
sizeintegerpixels per view (default 640)
timenumberseconds into the animation (default: its middle; inspect_rig gives each problem's worst moment)
typestringthe body type, when it can't be told from the file (afk.ai's files say)
viewsarraydefault front and left (front looks from +Z, so the model's left is on the image's right)
weightsboolean | stringtrue: color the skin by the bone each part follows; a bone name: how much each part follows that bone (blue none, red all)
xraybooleanthe mesh see-through, to see joints inside it

adjust_animation

Change animations of a rigged .glb as afk.ai/rig's Adjust > Animation does, and write a new .glb: turn parts of the body (controls such as armsUp, posture, headUp in degrees), change how it moves (speed, motion, bounce, sway, lag, lookAhead, width, lift, part:arms...), move a hand, foot or the body (positions, the limb reaching for it), and for humans keep the arms out of the body. inspect_rig lists the controls this body type has, with their ranges. Reports each changed animation's ground [before, after] (and arms-through-body frames with keep_arms_out). Runs on this computer, free.

ParameterTypeDescription
file *stringa rigged .glb (absolute, or relative to the server's working directory): one rig_model wrote, or any model on afk.ai's skeletons
animationsthe animations to change: all (default) or names
controlsobjectcontrol id -> value, e.g. {"armsUp": 15, "speed": 1.2}. Turns are degrees; movement multiplies (1 leaves it) except lag (seconds), lookAhead (0-1) and width (model units)
keep_arms_outnumberhumans: turn the arms, spine and neck as little as possible so arms and hands stay out of the body (1: all of the correction)
outputstringwhere to write the result (default: the next free <model>-v2.glb, -v3... beside it; never the input)
positionsobjecthand_l, foot_r... or body: moved by an offset, the limb bending to reach it (feet stay planted)
rangesobjectonly part of each animation for a control or position id (seconds), eased in and out
typestringthe body type, when it can't be told from the file (afk.ai's files say)

fix_stretching

Find where the skin of a rigged .glb stretches or tears across its animations and heal it (afk.ai/rig's Fix stretching), writing a new .glb. Reports torn skin [before, after] overall and per animation. Runs on this computer, free.

ParameterTypeDescription
file *stringa rigged .glb (absolute, or relative to the server's working directory): one rig_model wrote, or any model on afk.ai's skeletons
animationsthe animations to check and heal across (default all)
outputstringwhere to write the result (default: the next free <model>-v2.glb, -v3... beside it; never the input)
typestringthe body type, when it can't be told from the file (afk.ai's files say)

fix_spot

Fix the skin weights of one spot of a rigged .glb (afk.ai/rig's Fix a spot) and write a new .glb. Pick the spot with where (every given condition must hold), then: follow (it moves with the wrong part: give it to bone), smooth (pinched, jagged or creased: strength light, medium or strong) or redo (it tears or sticks to another part: its weights worked out again from the nearest bones). Reports the bones the spot follows [before, after]. Runs on this computer, free.

ParameterTypeDescription
file *stringa rigged .glb (absolute, or relative to the server's working directory): one rig_model wrote, or any model on afk.ai's skeletons
fix *string
where *the spot: near a joint, moving with bones, a mesh, a piece, a box or a sphere (all given must hold)
bonestringfollow: the bone the spot should move with
outputstringwhere to write the result (default: the next free <model>-v2.glb, -v3... beside it; never the input)
strengthstringsmooth: how far (default medium)
typestringthe body type, when it can't be told from the file (afk.ai's files say)