Log inGet started
Package

anim_gen.service

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

anim_gen (service)

Text-to-motion generation via the Uthana API (the async text-to-motion-3.0 model). A .service asset — a plain Luau module, resolvable as @builtin::services.anim_gen, exposing a generator that runs through the credit-metered service path.

Operations

  • generate({ prompt, format?, fps?, loop?, in_place? }) — text-to-motion. format is 'glb' (default) or 'fbx'; fps is 24 / 30 / 60 (optional). Submits the job, polls it to completion, downloads the retargetable humanoid clip, and writes it under /zero/source/generated/animations/. loop = true blends the clip's end into its start, so its last pose is its first and it plays round without a jump; in_place = true takes its travel across the ground out of the hips, keeping their rise and fall. The completed row's outputs.shaped names each clip shaped and its seam: how far its last pose is from its first (rotation degrees, translation metres), how far its root travels (travel), and whether each is within the tolerance (modules.clipShape). Any .animation takes the same shaping afterwards with ref:shape({ loop, inPlace }). Each landed clip's README states the motion it was generated from and how it was shaped, so the world publishes it.

An avatar's emote is generated onto the avatar in one call: avatar.emote(avatar, "Wave", { description = "a cheerful wave" }) asks for a looping, in-place clip and makes the emote of it once it lands.

Using it

local anim = asset.resolve("anim_gen", "service")
print(anim:cost(), anim:balance())          -- budget before spending
local g = anim:invoke({ prompt = "walk forward then wave hello" })

-- Generation is async. Watch the run until it settles; a completed row's
-- `asset` is the finished, spawnable clip.
local row = tools.use("services", "status", { id = g.id })
while row ~= nil and row.status ~= "completed" and row.status ~= "failed" do
    task.wait(5)
    row = tools.use("services", "status", { id = g.id })
end
print(row.status, row.asset)

The handle's asset_path is where the run directs the raw generated file; the asset it becomes is the completed status row's asset, which is what to spawn. The clip is a standard humanoid animation, retargetable onto any avatar rig.

Cost

generate costs credits (see :cost()); the exact amount charged is returned on the generation handle. Check :balance() first.