mpfb_set_face_units
Set ARKit face units (0.0-1.0) on a MakeHuman character to compose facial expressions, with merge or replace modes and validation.
Instructions
Compose a MakeHuman character's face from ARKit face units - the same
52-unit vocabulary mpfb_get_face_units reads and MPFB's own composer
panel edits, applied directly to the !ex- shape keys.
Send the whole expression as one call. face_units is a list of
{face_unit, value}, value in 0.0-1.0. Call mpfb_get_face_units
first if you need the exact 52 legal names, grouped by region in
known_face_units.
Nothing is written unless every name resolves. Every face_unit is
checked against MPFB's own vocabulary before anything is touched; one
misspelled name refuses the whole call and unknown_face_units names
it together with the closest legal spellings. This tool also refuses
outright when the faceunits01 asset pack is not installed, since
every target file would then be missing - check
mpfb_get_face_units' faceunits01_installed first if unsure.
mode is "merge" by default, matching MPFB: a face unit not
mentioned in face_units is left exactly as it was. "replace" zeroes
every one of the 52 units before applying this call's entries, which is
the difference between "smile a bit more" and "make this face and
nothing else"; removed_by_replace names what it zeroed.
refit (default true, unlike every other refitting tool here:
composing is normally one call) re-fits the mesh assets and the rig afterwards.
A composed face is transient. MPFB has two mechanisms over one set
of shape keys: this tool writes them directly, while saved expressions
live on a stack (mpfb_get_expression) that mpfb_apply_expressions
and preset loads rebuild the face from, discarding anything composed
here. result's matches_stack is false when the face now differs
from the stack, and unexplained_face_units lists what the next rebuild
would overwrite. mpfb_save_expression keeps a composed face.
result carries changes - one entry per unit actually written, with
previous_value and new_value - plus loaded_from_disk (units whose
shape key had to be created from a target file on this call),
could_not_load (a unit whose target file was missing even though the
pack passed its own install probe - a partially installed pack), and
skipped_absent_at_zero (a unit requested at 0.0 with no shape key
yet, which is left alone rather than created). basemesh_name names
the object actually changed. A subject that cannot be resolved
(found: false, subject_not_found) and a basemesh in edit mode
(ready: false) are answers, not errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | merge | |
| name | No | ||
| refit | No | ||
| face_units | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||