set_polygroup_material_id
Assign a MaterialID to every triangle in a polygroup to paint parts cheaply. Check polygroup_id_valid to confirm the group existed and painting applied.
Instructions
Stamp a MaterialID onto every triangle of one polygroup via UGeometryScriptLibrary_MeshMaterialFunctions::SetPolygroupMaterialID. This is usually the cheapest way to paint a part: append_mesh_primitive lays primitives down with PerFace polygroups, so each appended piece is already its own group. HONEST GATE: the engine reports whether the polygroup ID actually existed, and that flag is surfaced as polygroup_id_valid — a false there means nothing was painted, even though the call succeeded.
Returns: { actor_name, polygroup_id, material_id, polygroup_id_valid: bool, max_material_id_after: int, distinct_material_ids_after: int, applied: bool }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actor_name | Yes | Label or name of the target DynamicMeshActor. | |
| material_id | No | MaterialID to write (>= 0). | |
| polygroup_id | No | Polygroup ID to repaint. | |
| polygroup_layer | No | Optional extended polygroup layer index. Omit for the default layer. |