> [!info] Context
> **LOP Attribute Wrangle** — Run Over: Primitives
> Assigns a `material:binding` relationship to the targeted prims.
# Assign Material to Prims
## VEX
```c
string rel = "material:binding";
string targets[] = array("/materials/Grey_MAT");
usd_setrelationshiptargets(0, @primpath, rel, targets);
```
## Key Function
| Function | Purpose |
|---|---|
| `usd_setrelationshiptargets(0, path, rel, targets[])` | Set a USD relationship (here `material:binding`) |
> [!warning] `usd_bindmaterial` does NOT exist in VEX
> Material binding must be done via `usd_setrelationshiptargets` with `"material:binding"` as the relationship name.
## Instance Proxies
USD **instance proxy prims are read-only** — neither this wrangle nor an Assign Material LOP can author on them directly. To assign materials to instanced geometry:
1. **Configure Primitive LOP** — target the prototype root prim, set `Instanceable` to **Off**
2. **Wrangle** or **Assign Material** — now works since prims are no longer proxies
3. **Configure Primitive LOP** — set `Instanceable` back to **On**
---
See also: [[HOUDINI VEX]] | [[HOUDINI Guideline for AI generated VEX]]