mpfb_set_skin
Apply a skin to a MakeHuman character in Blender from MPFB's skin library, replacing all existing materials. Choose a skin by path or fragment or pick a skin type.
Instructions
Give a MakeHuman character a skin, the way MPFB's own skin library panel does.
This destroys every material already on the character. MPFB deletes
all materials on the basemesh and on the body proxy, node groups
included, before building the new one, and there is no undo across the
socket. materials_destroyed names what went, per object.
Name the skin with either path or fragment, never both;
mpfb_list_assets reports both for every entry whose object_type is
Material (the skins subdir). A fragment is resolved by
basename, so resolved_path always reports which file was actually
loaded. Give neither only with skin_type="LAYERED", the one type
that builds a material from nothing.
skin_type is MAKESKIN (default), GAMEENGINE, ENHANCED,
ENHANCED_SSS or LAYERED: five entirely different node trees built
from the same MHMAT - MakeSkin's own, a plain PBR material for export,
the enhanced one without and with subsurface scattering, and the
multilayered one, which MPFB warns is expensive to render rather than
to build. All five cost about the same to build, so pick on the look
you want. The default follows MPFB's settings panel, not
set_character_skin()'s own signature, which defaults to
ENHANCED_SSS.
material_instances (default true) asks for the per-vertex-group
material slots - fingernails, lips, ears, nipples, toenails, genitals.
MPFB's UI forces it off for LAYERED, GAMEENGINE and MAKESKIN,
and so does this tool, so the default call creates no instances at
all. material_instances_requested comes back beside
material_instances_used, with a sentence when they differ.
On applied: true, result carries basemesh_name and
bodyproxy_name - MPFB applies the skin to the body proxy too, and
nothing else would tell you - plus resolved_path, material_source
(the fragment MPFB recorded, written only when an MHMAT was given,
so a LAYERED skin with no file leaves the previous value in place,
which material_source_before makes visible), skin_type_used,
material_instances_requested/_used, materials_destroyed,
material_slots per object, material_identified_as,
active_body_slot, and two facts nothing in Blender would show you:
settings_file_created, true when the enhanced skin types copied
enhanced_settings.default.json into your user config directory - the
only file mpfb-mcp ever writes outside the .blend - and
scale_assumption (METER/DECIMETER/CENTIMETER), which the
enhanced types derive from the character's scale_factor and which
changes the subsurface radii. It is null for the three types that do
not use it, and METER for an ordinary MPFB character.
Refusals come back as applied: false (and so performed: false) with
a blocked_by and a sentence, and change nothing on the way to finding
out: subject_not_found, unknown_skin_type (with
known_skin_types), no_material_given, skin_not_found,
not_object_mode, and skin_failed for a failure inside MPFB itself -
reported rather than raised precisely because the materials are already
gone by then.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| path | No | ||
| fragment | No | ||
| skin_type | No | MAKESKIN | |
| material_instances | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||