Skip to main content

Expression

Expression tools control facial weights, reaction presets, animation playback, and look-at behavior.

set_expression

Set facial expression weights on the active character. Weights are in the range 0.0–1.0.

Common expression names: happy, sad, angry, surprised, relaxed, neutral, aa, ih, ou, ee, oh, blink.

ParameterTypeDefaultDescription
expressionsRecord<string, number>Expression name → weight map. Required unless mode is "clear".
mode"set" | "modify" | "clear""modify""modify" updates only the listed expressions; "set" replaces all; "clear" resets to animation-controlled state.

Example — soft smile:

{
"expressions": { "happy": 0.8, "relaxed": 0.3 },
"mode": "modify"
}

For preset reactions with bundled sounds and animations, use play_reaction instead.


play_reaction

Play a named reaction preset on the active character. Each preset combines a facial expression, an optional VRMA animation, and an optional sound effect.

Reactions gracefully degrade — if the animation or sound asset is not installed, the expression still plays.

ParameterTypeDefaultDescription
reactionstringrequiredReaction name (see table below)
messagestringOptional text message associated with the reaction

Available reactions:

NameExpressionAnimationSound
happyhappy 1.0idle-happysuccess
sadsad 0.8
confusedsurprised 0.4
errorangry 0.3, sad 0.4error
successhappy 0.9celebratesuccess
thinkingneutral 0.5thinking
surprisedsurprised 0.9notification
neutral

play_animation

Play a VRMA animation on the active character. Use the homunculus://assets resource to discover available VRMA asset IDs.

ParameterTypeDefaultDescription
assetstringrequiredVRMA animation asset ID (e.g. vrma:idle-maid)
repeat"never" | "forever" | string"never""never" plays once, "forever" loops, or pass a number string like "3" to repeat N times
transition_secsnumber0.3Crossfade transition duration in seconds
waitbooleanfalseWait for animation to complete before returning
reset_spring_bonesbooleanfalseReset SpringBone physics on transition to prevent bouncing

Example — loop an idle animation:

{
"asset": "vrma:idle-maid",
"repeat": "forever",
"transition_secs": 0.5
}

set_look_at

Control where the active character's eyes look.

ParameterTypeDefaultDescription
mode"cursor" | "none"required"cursor" follows the mouse pointer; "none" disables look-at