addPreviewMaterialInterface#
Fully qualified name: usdex::core::addPreviewMaterialInterface
- bool usdex::core::addPreviewMaterialInterface(
- pxr::UsdShadeMaterial &material,
Adds
UsdShadeInputsto the material prim to create an “interface” to the underlying Preview Shader network.All non-default-value
UsdShadeInputson the effective surface shader for the universal render context will be “promoted” to theUsdShadeMaterialas newUsdShadeInputs. They will be connected to the original source inputs on the shaders, to drive those values, and they will be authored with a value matching what had been set on the shader inputs at the time this function was called.Additionally,
UsdUVTexture.fileinputs on connected shaders will be promoted to the material, following the same logic as direct surface inputs.Note
It is preferable to author all initial shader attributes (including textures) before calling
addPreviewMaterialInterface().Warning
This function will fail if there is any other render context driving the material surface. It is only suitable for use on Preview Shader networks, such as the network generated by
definePreviewMaterial()and its associatedadd*Texturefunctions. If you require multiple contexts, you should instead construct a Material Interface directly, or with targetted end-user interaction.- Parameters:
material – The material prim
- Returns:
Whether or not the Material inputs were added successfully