From b422d841b1cf75a56699d21deae4fe2a7e335c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Delgado=20Kr=C3=A4mer?= Date: Sat, 9 Mar 2024 15:49:02 +0100 Subject: [PATCH] Require MaterialX 1.38.6 as a minimum --- CMakeLists.txt | 2 +- src/libguc/src/materialx.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60bff49..1466d66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(pxr CONFIG REQUIRED) # Find MaterialX library provided by the USD installation. # Since we use UsdMtlx, using a custom MaterialX version leads to conflicts. -find_package(MaterialX REQUIRED HINTS ${pxr_DIR}) +find_package(MaterialX 1.38.6 REQUIRED HINTS ${pxr_DIR}) # We need to open PNG and JPEG files in order to read the number of channels # for shading node creation. OIIO should be provided by the USD installation. diff --git a/src/libguc/src/materialx.cpp b/src/libguc/src/materialx.cpp index 7f643c2..8968d33 100644 --- a/src/libguc/src/materialx.cpp +++ b/src/libguc/src/materialx.cpp @@ -586,7 +586,6 @@ namespace guc } } -#if MATERIALX_MINOR_VERSION > 38 || (MATERIALX_MINOR_VERSION == 38 && MATERIALX_BUILD_VERSION >= 5) if (material->has_emissive_strength) { const cgltf_emissive_strength* emissiveStrength = &material->emissive_strength; @@ -594,7 +593,6 @@ namespace guc mx::InputPtr emissiveStrengthInput = shaderNode->addInput("emissive_strength", MTLX_TYPE_FLOAT); emissiveStrengthInput->setValue(emissiveStrength->emissive_strength); } -#endif if (material->has_clearcoat) { @@ -648,7 +646,6 @@ namespace guc iorInput->setValue(ior->ior); } -#if MATERIALX_MINOR_VERSION > 38 || (MATERIALX_MINOR_VERSION == 38 && MATERIALX_BUILD_VERSION >= 6) if (material->has_iridescence) { const cgltf_iridescence* iridescence = &material->iridescence; @@ -663,7 +660,6 @@ namespace guc mx::InputPtr iridescenceThicknessInput = shaderNode->addInput("iridescence_thickness", MTLX_TYPE_FLOAT); setIridescenceThicknessInput(nodeGraph, iridescenceThicknessInput, iridescence); } -#endif if (material->has_specular) {