addPrimvarShaderToPbrMaterial#
Fully qualified name: usdex::core::addPrimvarShaderToPbrMaterial
- bool usdex::core::addPrimvarShaderToPbrMaterial(
- pxr::UsdShadeMaterial &material,
- const std::string &surfaceInputName,
- const std::string &primvarName,
- const pxr::VtValue &fallbackValue = pxr::VtValue(),
Adds a primvar reader shader to the material prim and connects it to a surface input.
It is expected that the material was created by
definePbrMaterial()Note
This function will only work on the surface shader
ND_open_pbr_surface_surfaceshader, not shaders within the shader network. For connecting inputs within a shader network, useconnectPrimvarShader().- Parameters:
material – The material prim
surfaceInputName – The name of the input on the surface shader (not including the
inputs:prefix, eg.base_color)primvarName – The name of the primvar to read (not including the
primvars:prefix, eg.paintColor)fallbackValue – An optional fallback value to use if the primvar is not found
- Returns:
Whether or not the primvar shader was added to the material