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 ); } }