set_procedural_mesh_material
Assign a material asset to a specific slot on an actor's procedural mesh component in Unreal Editor, verifying the result and returning the previous material path.
Instructions
Assign a material to one slot of the first UProceduralMeshComponent on an editor-world actor (found by label or object name) with SetMaterial, marking the actor package dirty without saving. Returns the loaded material_path, element_index and previous_material_path when the slot had a material. element_index may name a slot the component has (one per section, or an existing override) or the next one past them; a negative one, or one further past, is an error checked before anything changes. A slot that already holds the material succeeds with material_set false and a note, touching nothing; otherwise material_set is read back from the slot and the call fails when it is false.
Returns: { actor_label, material_path, element_index, material_set, previous_material_path?, note? }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actor_label | Yes | Editor label or object name of the actor; the first actor matching either is used | |
| element_index | No | Material slot index, usually the section index; default 0; from 0 up to the larger of the section count and the override count | |
| material_path | Yes | Material or material instance asset path, e.g. "/Game/Materials/M_Rock" |