assign_material_faces
Assign an existing material to mesh faces selected by a condition, leaving other faces unchanged and adding a material slot if needed. Create the material with set_material first.
Instructions
Put an existing material on part of a mesh: the picked faces get it, the other faces keep theirs. Adds a slot if the object has none for it.
Other faces keep their material. One mesh with several materials costs one draw call per material in the engine, so keep
the count low. Create the material first with set_material.
where picks faces (or vertices, edges) by a condition, all given keys must hold: normal ('+Z', '-X' or [x,y,z]) with
angle (degrees, default 25); x, y, z ranges [min, max] (null means open) on the world centre; box [[x0,y0,z0],[x1,y1,z1]];
area [min, max]; index [...]. {} or null picks everything. Look at mesh_info first to see where the faces are.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| where | No | ||
| object | Yes | ||
| material | Yes |