Material Assignments, Methods, Direct Binding
- Direct Binding:
- - Direct binding involves assigning a material directly to a specific prim using the
material:binding relationship.
- - This method is straightforward and is used when you need to assign materials to individual prims without complex hierarchy considerations.
- - Example:
from pxr import Usd, UsdShade
stage = Usd.Stage.Open("path/to/your.usda")
prim = stage.GetPrimAtPath("/path/to/prim")
material = UsdShade.Material.Define(stage, "/path/to/material")
UsdShade.MaterialBindingAPI(prim).Bind(material)