connectPrimvarShader#

Fully qualified name: usdex::core::connectPrimvarShader

bool usdex::core::connectPrimvarShader(
pxr::UsdShadeInput &shaderInput,
const std::string &primvarName,
const pxr::VtValue &fallbackValue = pxr::VtValue(),
)#

Connects a surface input to a primvar reader shader.

A primvar reader shader will be created if it does not already exist.

Parameters:
  • shaderInput – The surface input to connect the primvar reader to

  • 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 connected to the surface input