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 shader input to a primvar reader shader.
A primvar reader shader will be created if it does not already exist.
Note
The shader input must be within a Preview Surface or MaterialX shader network.
- Parameters:
shaderInput – The shader 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 shader input