mpfb_list_asset_materials
List all alternative materials available for an equipped MHCLO asset and identify the one currently applied, without modifying the character.
Instructions
List the alternative materials that ship beside one equipped MHCLO asset - the other colours of a hat - and name the one it is wearing now. Changes nothing about the character.
These are not in mpfb_list_assets' answer. That tool lists MPFB's
asset library sections; alternative materials live in the asset's own
directory instead. This is the only catalogue for them, and it is what
mpfb_set_asset_material consumes.
name is the asset's own Blender object name, as
mpfb_list_objects reports it or as mpfb_add_asset returned it in
asset_object_name.
The answer is a snapshot. MPFB caches this scan per asset and
nothing invalidates that cache on its own, so a material added to the
asset's directory after the first call for that asset - in this
Blender session - will not appear. refresh=true clears the cache
first; cache_invalidated says whether it did. That clear is global -
every asset's cached list is dropped, not only this one's - which is
why the default stays false.
result carries asset_object_name, object_type, asset_source and
the asset_subdir searched; default_material, the absolute path the
asset's own MHCLO names, with exists saying whether that file is
there, or null with default_material_reason saying why not;
current_alternative_material, the fragment recorded on the object
now; materials, one entry per alternative with path, fragment,
name and is_default - MPFB does not filter the asset's own
material out of this scan, so the default usually appears and is
flagged rather than removed; count; search_roots, the directories
actually scanned, so "this hat has no other colours" is distinguishable
from "the hat's asset source no longer resolves"; and
cache_invalidated.
An object that is not an asset comes back as found: false, or with an
empty list and an explanation, never as an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| refresh | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||