Skip to content

Commit

Permalink
Use default material binding for UsdPreviewSurfaces if MaterialX is n…
Browse files Browse the repository at this point in the history
…ot used
  • Loading branch information
pablode committed Jul 13, 2024
1 parent 6fb358e commit a214dd5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/libguc/src/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,23 +761,23 @@ namespace guc

void Converter::createMaterialBinding(UsdPrim& prim, const std::string& materialName)
{
#ifndef NDEBUG
if (!TfGetEnvSetting(GUC_DISABLE_PREVIEW_MATERIAL_BINDINGS))
#endif
if (m_params.emitMtlx)
{
UsdShadeMaterialBindingAPI::Apply(prim).Bind(
UsdShadeMaterial::Get(m_stage, makeUsdPreviewSurfaceMaterialPath(materialName)),
UsdShadeMaterial::Get(m_stage, makeMtlxMaterialPath(materialName)),
UsdShadeTokens->fallbackStrength,
UsdShadeTokens->preview
UsdShadeTokens->allPurpose
);
}

if (m_params.emitMtlx)
#ifndef NDEBUG
if (!TfGetEnvSetting(GUC_DISABLE_PREVIEW_MATERIAL_BINDINGS))
#endif
{
UsdShadeMaterialBindingAPI::Apply(prim).Bind(
UsdShadeMaterial::Get(m_stage, makeMtlxMaterialPath(materialName)),
UsdShadeMaterial::Get(m_stage, makeUsdPreviewSurfaceMaterialPath(materialName)),
UsdShadeTokens->fallbackStrength,
UsdShadeTokens->allPurpose
m_params.emitMtlx ? UsdShadeTokens->preview : UsdShadeTokens->allPurpose
);
}
}
Expand Down

0 comments on commit a214dd5

Please sign in to comment.