From a214dd514e9d496fb500c159a4b70adef39eff65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Delgado=20Kr=C3=A4mer?= Date: Sat, 13 Jul 2024 13:42:06 +0200 Subject: [PATCH] Use default material binding for UsdPreviewSurfaces if MaterialX is not used --- src/libguc/src/converter.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libguc/src/converter.cpp b/src/libguc/src/converter.cpp index 2766939..964fb0c 100644 --- a/src/libguc/src/converter.cpp +++ b/src/libguc/src/converter.cpp @@ -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 ); } }