From 373f0fde650246f65883341e4005113061619edd Mon Sep 17 00:00:00 2001 From: Jonathan Stone Date: Thu, 30 Jan 2025 11:41:19 -0800 Subject: [PATCH] Simplify greysphere example materials - Remove default-valued inputs from the Standard Surface Greysphere example materials, leaving only those inputs that have a visual impact. - Decouple a JavaScript unit test from the specific element counts of example materials. --- javascript/MaterialXTest/codeExamples.spec.js | 20 +++---------------- .../standard_surface_greysphere.mtlx | 3 --- ...andard_surface_greysphere_calibration.mtlx | 3 --- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/javascript/MaterialXTest/codeExamples.spec.js b/javascript/MaterialXTest/codeExamples.spec.js index 8cff44c3fe..ba95641500 100644 --- a/javascript/MaterialXTest/codeExamples.spec.js +++ b/javascript/MaterialXTest/codeExamples.spec.js @@ -92,29 +92,15 @@ describe('Code Examples', () => // Traverse the document tree in depth-first order. const elements = doc.traverseTree(); - let elementCount = 0; - let nodeCount = 0; - let fileCount = 0; + let imageCount = 0; for (let elem of elements) { - elementCount++; - // Display the filename of each image node. if (elem.isANode('image')) { - nodeCount++; - const input = elem.getInput('file'); - if (input) - { - fileCount++; - const filename = input.getValueString(); - expect(elem.getName()).to.equal('image1'); - expect(filename).to.equal('greysphere_calibration.png'); - } + imageCount++; } } - expect(elementCount).to.equal(21); - expect(nodeCount).to.equal(1); - expect(fileCount).to.equal(1); + expect(imageCount).to.greaterThan(0); }); it('Building a MaterialX Document', async () => diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_greysphere.mtlx b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere.mtlx index 92a1c34190..a5bba1b99c 100644 --- a/resources/Materials/Examples/StandardSurface/standard_surface_greysphere.mtlx +++ b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere.mtlx @@ -1,11 +1,8 @@ - - - diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.mtlx b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.mtlx index 584f440cd4..b33bcd586f 100644 --- a/resources/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.mtlx +++ b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.mtlx @@ -17,11 +17,8 @@ - - -