addMetallicTextureToPreviewMaterial#

Fully qualified name: usdex::core::addMetallicTextureToPreviewMaterial

bool usdex::core::addMetallicTextureToPreviewMaterial(
pxr::UsdShadeMaterial &material,
const pxr::SdfAssetPath &texturePath,
)#

Adds a single channel metallic texture to a preview material.

It is expected that the material was created by definePreviewMaterial()

The texture will be sampled using texture coordinates from the default UV set (generally named primvars:st).

Note

If you intend to create a Material Interface, it is preferable to author all initial shader attributes (including textures) before calling addPreviewMaterialInterface(). This function will not attempt to reconcile any existing inputs on the Material.

Parameters:
  • material – The material prim

  • texturePath – The SdfAssetPath to the texture file

Returns:

Whether or not the texture was added to the material