mpfb_save_preset
Save a MakeHuman character as an MPFB preset file, capturing phenotype, rig, body parts, clothes, skin and eyes for later rebuilding. Refuses to replace an existing preset unless overwrite is true.
Instructions
Save a character as an MPFB preset - phenotype, modeling targets, rig,
body parts, garments, skin and eye materials - to be rebuilt later with
mpfb_create_human_from_preset or from MPFB's own preset panel.
This writes a file outside the .blend, and nothing in Blender can
undo it.
preset_name is a name, never a path: the file is always
human.<preset_name>.json in MPFB's user config directory, and path
in the response says which file that was. Letters, digits, _, - and .
only, at most 64 characters, no leading dot - stricter than MPFB's own
panel, which rejects only a space, so that a name cannot become a path.
basemesh_name says which character was actually serialized.
overwrite (default false) is the only thing standing between a call
and the loss of an existing preset. With it false and the preset
present, the tool refuses - blocked_by: "preset_exists", nothing
written - and file_before carries that file's size and age so the
decision can be made from the response.
A generated Rigify rig does not round-trip. MPFB stores the meta
rig it was generated from, so loading the preset back gives you the
meta rig and mpfb_generate_rigify_rig finishes the job. Nothing is
lost and nothing fails; rig_identified_as and rig_saved_as show the
substitution on the call where it happened.
On saved: true (and so performed: true), result carries path,
size_bytes, modified, overwrote, file_before (the replaced
file's facts, or null), config_dir, basemesh_name, rig_object_name,
rig_identified_as/rig_saved_as, and contents - what the written
file actually holds, read back from it: rig, proxy, bodyparts,
clothes, skin_mhmat, skin_material_type, eyes_material_type,
target_count, expression_count, makeup_count.
Refusals come back as saved: false with a blocked_by, having
written nothing: subject_not_found, preset_exists,
not_a_human_project (MPFB only serializes characters made within
MPFB, not imported meshes), rig_not_identifiable (an armature MPFB
cannot name - for a custom rig, its definition is no longer in your
user data), config_dir_missing and serialize_failed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| overwrite | No | ||
| preset_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||