mpfb_add_asset
Equip a MakeHuman character in Blender with one MHCLO mesh asset, such as a garment, body part, or proxy, by specifying the required object_type; rig first so garments attach correctly.
Instructions
Equip a MakeHuman character with one mesh asset from an MHCLO - a garment, a body part (hair, eyes, eyebrows, eyelashes, teeth, tongue) or the body proxy.
Rig the character before dressing it: MPFB rigs a garment only if a
rig is present when the garment is attached, and nothing rigs it
retroactively. The asset is attached either way, and rigged_to names
the armature or is null with parented_to naming the basemesh.
object_type is required, and is exactly what
mpfb_list_assets reports for the entry: Clothes, Proxymeshes,
Eyes, Eyebrows, Eyelashes, Hair, Teeth or Tongue. MPFB's
own function defaults it to "Clothes", which mislabels a body part
silently and permanently, so there is no default here;
object_type_recorded echoes what was stored.
Name the asset with either path or fragment, never both;
mpfb_list_assets reports both. A fragment ("fedora/fedora.mhclo")
is portable but is resolved by basename, so two packs shipping
hat.mhclo resolve to a coin toss - check resolved_path when
path_resolved_by is "fragment".
material_type is MAKESKIN, GAMEENGINE, PROCEDURAL_EYES or
NONE, and is best left unset: it then follows MPFB's settings panel
per asset type - NONE for Proxymeshes, MAKESKIN for everything
else - and material_type_used reports the choice. PROCEDURAL_EYES
is accepted only for Eyes. NONE deletes the imported mesh's
materials and creates nothing, even when the MHCLO names one;
material_created and warnings say when that happened.
subdiv_levels (default 1, MPFB's own) sets the subdivision modifier's
render level, viewport level 0; 0 adds no modifier.
set_up_rigging, interpolate_weights, import_subrig and
import_weights are MPFB's own flags at MPFB's own defaults. Fitting
to the body and the delete group are unconditional, so neither has an
argument, and an alternative material is chosen afterwards with
mpfb_set_asset_material.
On added: true, result carries asset_object_name - read off the
created object, since Blender uniquifies a name already in use, and the
address mpfb_remove_asset and mpfb_set_asset_material need - plus
basemesh_name, resolved_path/path_resolved_by/asset_source,
object_type_recorded, material_type_used,
material_created/material_name, rigged_to or parented_to,
subrig_object_name, delete_group_name and
delete_group_applied_to, subdiv_modifier_added, warnings for what
MPFB only logs, and proxy_extras - the four things a Proxymeshes
asset gets from MPFB's .mhm loading path, which this follows rather
than its proxy library panel.
Refusals come back as added: false (and so performed: false) with a
blocked_by and a sentence: subject_not_found, asset_not_found,
unknown_object_type (with known_object_types),
invalid_material_type, no_asset_subdir and not_object_mode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| path | No | ||
| fragment | No | ||
| object_type | Yes | ||
| import_subrig | No | ||
| material_type | No | ||
| subdiv_levels | No | ||
| import_weights | No | ||
| set_up_rigging | No | ||
| interpolate_weights | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||