diff --git a/documents/Specification/MaterialX.Proposals.md b/documents/Specification/MaterialX.Proposals.md
index d387d28718..1aaa930923 100644
--- a/documents/Specification/MaterialX.Proposals.md
+++ b/documents/Specification/MaterialX.Proposals.md
@@ -219,12 +219,6 @@ In #1201 it was decided that separate periodic versions of all of the noises is
* **`bump`**: Existing node, proposal to add a vector3 `bitangent` input
-
-
-* **`geompropvalueuniform`**: the value of the specified uniform geometric property (defined using <geompropdef>) of the currently-bound geometry. This node's type must match that of the referenced geomprop.
- * `geomprop` (uniform string): the geometric property to be referenced.
- * `default` (same type as the geomprop's value): a value to return if the specified `geomprop` is not defined on the current geometry.
-
Note: when <geompropvalueuniform> is added, the text in the first paragraph of the Specification about Node Inputs should be revised to include "<geompropvalueuniform>" as an example of "or any other node whose output is explicitly declared to be uniform".
diff --git a/documents/Specification/MaterialX.Specification.md b/documents/Specification/MaterialX.Specification.md
index 6d126f01cb..52763fd321 100644
--- a/documents/Specification/MaterialX.Specification.md
+++ b/documents/Specification/MaterialX.Specification.md
@@ -1093,6 +1093,12 @@ Standard Geometric nodes:
* `geomprop` (uniform string): the geometric property to be referenced.
* `default` (same type as the geomprop's value): a value to return if the specified `geomprop` is not defined on the current geometry.
+
+
+* **`geompropvalueuniform`**: the value of the specified uniform geometric property (defined using <geompropdef>) of the currently-bound geometry. This node's type must match that of the referenced geomprop.
+ * `geomprop` (uniform string): the geometric property to be referenced.
+ * `default` (same type as the geomprop's value): a value to return if the specified `geomprop` is not defined on the current geometry.
+
Additionally, the `geomcolor` and `geompropvalue` nodes for color3/color4-type properties can take a `colorspace` attribute to declare what colorspace the color property value is in; the default is "none" for no colorspace declaration (and hence no colorspace conversion).
diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt
index 6852090932..2b2097e203 100644
--- a/libraries/CMakeLists.txt
+++ b/libraries/CMakeLists.txt
@@ -1,10 +1,7 @@
if(NOT SKBUILD)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}"
- PATTERN "CMakeLists.txt" EXCLUDE
- PATTERN "pbrlib_genosl_impl.*" EXCLUDE)
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.mtlx"
- DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx)
+ PATTERN "CMakeLists.txt" EXCLUDE)
endif()
set(MATERIALX_PYTHON_LIBRARIES_PATH "${MATERIALX_PYTHON_FOLDER_NAME}/${MATERIALX_INSTALL_STDLIB_PATH}")
@@ -15,8 +12,5 @@ endif()
if(MATERIALX_BUILD_PYTHON)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}"
- PATTERN "CMakeLists.txt" EXCLUDE
- PATTERN "pbrlib_genosl_impl.*" EXCLUDE)
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.mtlx"
- DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx)
+ PATTERN "CMakeLists.txt" EXCLUDE)
endif()
diff --git a/libraries/bxdf/usd_preview_surface.mtlx b/libraries/bxdf/usd_preview_surface.mtlx
index 4abdb91d9f..afc6954af9 100644
--- a/libraries/bxdf/usd_preview_surface.mtlx
+++ b/libraries/bxdf/usd_preview_surface.mtlx
@@ -62,8 +62,13 @@
-
-
+
+
+
+
+
+
+
@@ -359,11 +364,18 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
diff --git a/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx b/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
index ad3a21e9cf..0625d17a25 100644
--- a/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
+++ b/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx
@@ -157,7 +157,6 @@
-
@@ -165,6 +164,10 @@
+
+
+
+
diff --git a/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx b/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
index 6ac2b862dd..05dbc995d6 100644
--- a/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
+++ b/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx
@@ -159,7 +159,6 @@
-
@@ -167,6 +166,10 @@
+
+
+
+
diff --git a/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx b/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
index 3cb99052cf..ea09880543 100644
--- a/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
+++ b/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx
@@ -73,7 +73,6 @@
-
@@ -81,6 +80,10 @@
+
+
+
+
diff --git a/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx b/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
index db318976c5..bd2e2540b5 100644
--- a/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
+++ b/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx
@@ -159,7 +159,6 @@
-
@@ -167,6 +166,10 @@
+
+
+
+
diff --git a/libraries/stdlib/stdlib_defs.mtlx b/libraries/stdlib/stdlib_defs.mtlx
index 5b9b5bd5bc..6cebca7faf 100644
--- a/libraries/stdlib/stdlib_defs.mtlx
+++ b/libraries/stdlib/stdlib_defs.mtlx
@@ -1361,11 +1361,6 @@
-
-
-
-
-
@@ -1397,6 +1392,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
registerImplementation("IM_frame_float_" + GlslShaderGenerator::TARGET, HwFrameNode::create);
diff --git a/source/MaterialXGenMsl/MslShaderGenerator.cpp b/source/MaterialXGenMsl/MslShaderGenerator.cpp
index 9511fac7ba..d886d43e96 100644
--- a/source/MaterialXGenMsl/MslShaderGenerator.cpp
+++ b/source/MaterialXGenMsl/MslShaderGenerator.cpp
@@ -86,6 +86,8 @@ MslShaderGenerator::MslShaderGenerator() :
registerImplementation(elementNames, GeomPropValueNodeMsl::create);
registerImplementation("IM_geompropvalue_boolean_" + MslShaderGenerator::TARGET, GeomPropValueNodeMslAsUniform::create);
registerImplementation("IM_geompropvalue_string_" + MslShaderGenerator::TARGET, GeomPropValueNodeMslAsUniform::create);
+ registerImplementation("IM_geompropvalue_filename_" + MslShaderGenerator::TARGET, GeomPropValueNodeMslAsUniform::create);
+
//
registerImplementation("IM_frame_float_" + MslShaderGenerator::TARGET, HwFrameNode::create);
diff --git a/source/MaterialXTest/MaterialXFormat/XmlIo.cpp b/source/MaterialXTest/MaterialXFormat/XmlIo.cpp
index 6d3bb7868f..fb6f824c6c 100644
--- a/source/MaterialXTest/MaterialXFormat/XmlIo.cpp
+++ b/source/MaterialXTest/MaterialXFormat/XmlIo.cpp
@@ -265,42 +265,45 @@ TEST_CASE("Comments and newlines", "[xmlio]")
TEST_CASE("Fuzz testing", "[xmlio]")
{
mx::FileSearchPath searchPath = mx::getDefaultDataSearchPath();
- mx::FilePath examplesPath = searchPath.find("resources/Materials/Examples/StandardSurface");
+ mx::FilePath examplesPath = searchPath.find("resources/Materials/Examples");
std::mt19937 rng(0);
std::uniform_int_distribution randChar(0, 255);
- for (const mx::FilePath& filename : examplesPath.getFilesInDirectory(mx::MTLX_EXTENSION))
+ for (const mx::FilePath& path : examplesPath.getSubDirectories())
{
- // Read the example file into an XML string buffer.
- const std::string origString = mx::readFile(examplesPath / filename);
- REQUIRE(origString.size() > 0);
- std::uniform_int_distribution randPos(0, origString.size() - 1);
-
- // Iterate over test runs.
- for (size_t testRun = 0; testRun < 256; testRun++)
+ for (const mx::FilePath& filename : path.getFilesInDirectory(mx::MTLX_EXTENSION))
{
- std::string editString = origString;
+ // Read the example file into an XML string buffer.
+ const std::string origString = mx::readFile(path / filename);
+ REQUIRE(origString.size() > 0);
+ std::uniform_int_distribution randPos(0, origString.size() - 1);
- // Iterate over string edits.
- for (size_t editIndex = 0; editIndex < 32; editIndex++)
+ // Iterate over test runs.
+ for (size_t testRun = 0; testRun < 256; testRun++)
{
- // Randomly alter one character in the document.
- size_t charIndex = randPos(rng);
- size_t newChar = randChar(rng);
- editString[charIndex] = (char) newChar;
-
- // Attempt to interpret the edited string as a document, allowing only MaterialX exceptions.
- mx::DocumentPtr doc = mx::createDocument();
- try
- {
- mx::readFromXmlString(doc, editString, searchPath);
- doc->validate();
- }
- catch (const mx::Exception&)
+ std::string editString = origString;
+
+ // Iterate over string edits.
+ for (size_t editIndex = 0; editIndex < 32; editIndex++)
{
- // On a MaterialX exception, proceed to the next test run.
- break;
+ // Randomly alter one character in the document.
+ size_t charIndex = randPos(rng);
+ size_t newChar = randChar(rng);
+ editString[charIndex] = (char) newChar;
+
+ // Attempt to interpret the edited string as a document, allowing only MaterialX exceptions.
+ mx::DocumentPtr doc = mx::createDocument();
+ try
+ {
+ mx::readFromXmlString(doc, editString, searchPath);
+ doc->validate();
+ }
+ catch (const mx::Exception&)
+ {
+ // On a MaterialX exception, proceed to the next test run.
+ break;
+ }
}
}
}
diff --git a/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h b/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h
index 8d3e8c8720..9db87197f1 100644
--- a/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h
+++ b/source/MaterialXTest/MaterialXGenGlsl/GenGlsl.h
@@ -52,7 +52,7 @@ class GlslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester
whiteList =
{
"volumeshader", "volumematerial",
- "IM_constant_", "IM_dot_", "IM_angle", "IM_geompropvalue_boolean", "IM_geompropvalue_string",
+ "IM_constant_", "IM_dot_", "IM_angle", "IM_geompropvalue_boolean", "IM_geompropvalue_string", "IM_geompropvalue_filename",
"IM_light_", "IM_point_light_", "IM_spot_light_", "IM_directional_light_"
};
ShaderGeneratorTester::getImplementationWhiteList(whiteList);
diff --git a/source/MaterialXTest/MaterialXGenMsl/GenMsl.h b/source/MaterialXTest/MaterialXGenMsl/GenMsl.h
index eea7b86acb..c159919773 100644
--- a/source/MaterialXTest/MaterialXGenMsl/GenMsl.h
+++ b/source/MaterialXTest/MaterialXGenMsl/GenMsl.h
@@ -71,7 +71,7 @@ class MslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester
whiteList =
{
"displacementshader", "volumeshader", "surfacematerial", "volumematerial",
- "IM_constant_", "IM_dot_", "IM_angle", "IM_geompropvalue_boolean", "IM_geompropvalue_string",
+ "IM_constant_", "IM_dot_", "IM_angle", "IM_geompropvalue_boolean", "IM_geompropvalue_string", "IM_geompropvalue_filename",
"IM_light_", "IM_point_light_", "IM_spot_light_", "IM_directional_light_",
"ND_surfacematerial", "ND_volumematerial"
};
diff --git a/source/MaterialXTest/MaterialXGenOsl/GenOsl.h b/source/MaterialXTest/MaterialXGenOsl/GenOsl.h
index aa84a62218..d36c571a82 100644
--- a/source/MaterialXTest/MaterialXGenOsl/GenOsl.h
+++ b/source/MaterialXTest/MaterialXGenOsl/GenOsl.h
@@ -64,7 +64,7 @@ class OslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester
whiteList =
{
"displacementshader", "volumeshader",
- "IM_constant_", "IM_dot_", "IM_angle", "IM_geompropvalue"
+ "IM_constant_", "IM_dot_", "IM_angle", "IM_geompropvalue", "IM_geompropvalueuniform"
};
ShaderGeneratorTester::getImplementationWhiteList(whiteList);
}