From 641fcdb4298e36153fdd5ce871a161ef04781953 Mon Sep 17 00:00:00 2001 From: Yves Boudreault Date: Fri, 29 Oct 2021 08:54:48 -0400 Subject: [PATCH] MAYA-114519 Make Shader reader/writer test self contained Copying the MaterialX tests files so that the test is independent. --- .../UsdImportMaterialX.usda | 178 ++++++++++++++++++ .../standard_surface_gold.mtlx | 14 ++ .../standard_surface_jade.usda | 118 ++++++++++++ test/lib/mayaUsd/fileio/testShaderReader.py | 3 +- 4 files changed, 311 insertions(+), 2 deletions(-) create mode 100644 test/lib/mayaUsd/fileio/UsdImportMaterialX/UsdImportMaterialX.usda create mode 100644 test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_gold.mtlx create mode 100644 test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_jade.usda diff --git a/test/lib/mayaUsd/fileio/UsdImportMaterialX/UsdImportMaterialX.usda b/test/lib/mayaUsd/fileio/UsdImportMaterialX/UsdImportMaterialX.usda new file mode 100644 index 0000000000..92e04ce014 --- /dev/null +++ b/test/lib/mayaUsd/fileio/UsdImportMaterialX/UsdImportMaterialX.usda @@ -0,0 +1,178 @@ +#usda 1.0 +( + defaultPrim = "pPlatonic1" + metersPerUnit = 0.01 + upAxis = "Y" +) + +def Mesh "pPlatonic1" ( + prepend apiSchemas = ["MaterialBindingAPI"] + kind = "component" +) +{ + uniform bool doubleSided = 1 + float3[] extent = [(-3.928988, -3.9177284, -4), (3.928988, 3.9177284, 4)] + int[] faceVertexCounts = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3] + int[] faceVertexIndices = [0, 12, 14, 12, 13, 18, 12, 18, 14, 14, 18, 15, 13, 2, 16, 13, 16, 18, 18, 16, 17, 18, 17, 15, 15, 17, 1, 0, 19, 12, 19, 20, 23, 19, 23, 12, 12, 23, 13, 20, 3, 21, 20, 21, 23, 23, 21, 22, 23, 22, 13, 13, 22, 2, 0, 24, 19, 24, 25, 28, 24, 28, 19, 19, 28, 20, 25, 4, 26, 25, 26, 28, 28, 26, 27, 28, 27, 20, 20, 27, 3, 0, 29, 24, 29, 30, 33, 29, 33, 24, 24, 33, 25, 30, 5, 31, 30, 31, 33, 33, 31, 32, 33, 32, 25, 25, 32, 4, 0, 14, 29, 14, 15, 36, 14, 36, 29, 29, 36, 30, 15, 1, 34, 15, 34, 36, 36, 34, 35, 36, 35, 30, 30, 35, 5, 1, 17, 37, 17, 16, 41, 17, 41, 37, 37, 41, 38, 16, 2, 39, 16, 39, 41, 41, 39, 40, 41, 40, 38, 38, 40, 7, 2, 22, 42, 22, 21, 46, 22, 46, 42, 42, 46, 43, 21, 3, 44, 21, 44, 46, 46, 44, 45, 46, 45, 43, 43, 45, 8, 3, 27, 47, 27, 26, 51, 27, 51, 47, 47, 51, 48, 26, 4, 49, 26, 49, 51, 51, 49, 50, 51, 50, 48, 48, 50, 9, 4, 32, 52, 32, 31, 56, 32, 56, 52, 52, 56, 53, 31, 5, 54, 31, 54, 56, 56, 54, 55, 56, 55, 53, 53, 55, 10, 5, 35, 57, 35, 34, 61, 35, 61, 57, 57, 61, 58, 34, 1, 59, 34, 59, 61, 61, 59, 60, 61, 60, 58, 58, 60, 6, 1, 37, 59, 37, 38, 64, 37, 64, 59, 59, 64, 60, 38, 7, 62, 38, 62, 64, 64, 62, 63, 64, 63, 60, 60, 63, 6, 2, 42, 39, 42, 43, 67, 42, 67, 39, 39, 67, 40, 43, 8, 65, 43, 65, 67, 67, 65, 66, 67, 66, 40, 40, 66, 7, 3, 47, 44, 47, 48, 70, 47, 70, 44, 44, 70, 45, 48, 9, 68, 48, 68, 70, 70, 68, 69, 70, 69, 45, 45, 69, 8, 4, 52, 49, 52, 53, 73, 52, 73, 49, 49, 73, 50, 53, 10, 71, 53, 71, 73, 73, 71, 72, 73, 72, 50, 50, 72, 9, 5, 57, 54, 57, 58, 76, 57, 76, 54, 54, 76, 55, 58, 6, 74, 58, 74, 76, 76, 74, 75, 76, 75, 55, 55, 75, 10, 6, 63, 77, 63, 62, 81, 63, 81, 77, 77, 81, 78, 62, 7, 79, 62, 79, 81, 81, 79, 80, 81, 80, 78, 78, 80, 11, 7, 66, 79, 66, 65, 84, 66, 84, 79, 79, 84, 80, 65, 8, 82, 65, 82, 84, 84, 82, 83, 84, 83, 80, 80, 83, 11, 8, 69, 82, 69, 68, 87, 69, 87, 82, 82, 87, 83, 68, 9, 85, 68, 85, 87, 87, 85, 86, 87, 86, 83, 83, 86, 11, 9, 72, 85, 72, 71, 90, 72, 90, 85, 85, 90, 86, 71, 10, 88, 71, 88, 90, 90, 88, 89, 90, 89, 86, 86, 89, 11, 10, 75, 88, 75, 74, 91, 75, 91, 88, 88, 91, 89, 74, 6, 77, 74, 77, 91, 91, 77, 78, 91, 78, 89, 89, 78, 11] + rel material:binding = + point3f[] points = [(0, 0, -4), (2.8944273, 2.1029243, -1.7888544), (-1.105573, 3.4026036, -1.7888546), (-3.5777092, -3.1277327e-7, -1.7888546), (-1.1055732, -3.4026031, -1.7888544), (2.894427, -2.1029246, -1.7888544), (3.5777092, 0, 1.7888546), (1.1055727, 3.4026034, 1.7888544), (-2.8944275, 2.1029243, 1.7888546), (-2.894427, -2.1029248, 1.7888544), (1.1055733, -3.4026031, 1.7888544), (0, 0, 4), (-0.42431572, 1.3059093, -3.7569344), (-0.84863144, 2.6118186, -2.908303), (1.110873, 0.80709636, -3.7569344), (2.221746, 1.6141927, -2.908303), (0.26224142, 3.4189153, -2.0596716), (1.7974302, 2.9201021, -2.0596716), (0.7503699, 2.309401, -3.178618), (-1.3731143, -1.2004148e-7, -3.7569344), (-2.7462287, -2.4008295e-7, -2.908303), (-3.1705449, 1.305909, -2.0596716), (-2.221746, 2.6118186, -2.0596716), (-1.964494, 1.4272882, -3.178618), (-0.42431584, -1.3059093, -3.7569344), (-0.8486317, -2.6118186, -2.908303), (-2.221746, -2.6118186, -2.0596714), (-3.1705446, -1.3059098, -2.0596716), (-1.964494, -1.4272884, -3.178618), (1.1108729, -0.8070965, -3.7569344), (2.2217457, -1.614193, -2.908303), (1.7974302, -2.9201024, -2.0596716), (0.2622413, -3.4189153, -2.0596716), (0.75036967, -2.309401, -3.178618), (3.3326187, 0.80709636, -2.0596714), (3.3326187, -0.8070965, -2.0596716), (2.428248, -7.5007e-8, -3.178618), (2.6460614, 2.9201021, -0.68655723), (1.9595041, 3.418915, 0.68655705), (-0.42431587, 3.9177284, -0.68655735), (0.42431557, 3.9177284, 0.6865571), (1.2141238, 3.7366893, -0.75036997), (-1.9595045, 3.4189153, -0.68655735), (-2.6460617, 2.9201021, 0.6865571), (-3.8571017, 0.80709594, -0.68655723), (-3.5948603, 1.6141924, 0.6865571), (-3.1786182, 2.3094008, -0.75037), (-3.8571014, -0.80709666, -0.68655723), (-3.5948598, -1.614193, 0.68655705), (-1.9595044, -3.418915, -0.68655723), (-2.6460612, -2.9201024, 0.68655705), (-3.178618, -2.309401, -0.75036997), (-0.42431587, -3.9177284, -0.68655735), (0.4243159, -3.9177284, 0.6865572), (2.6460614, -2.9201021, -0.68655723), (1.9595044, -3.4189148, 0.68655705), (1.2141242, -3.7366896, -0.75037), (3.5948603, -1.6141931, -0.68655735), (3.857102, -0.8070966, 0.6865572), (3.5948603, 1.614193, -0.68655735), (3.857102, 0.8070965, 0.6865571), (3.928988, -3.75035e-8, -0.75037), (2.2217455, 2.611819, 2.0596714), (3.1705446, 1.3059096, 2.0596716), (3.178618, 2.3094013, 0.75036985), (-1.7974304, 2.9201021, 2.0596716), (-0.2622417, 3.4189153, 2.0596716), (-1.2141242, 3.7366896, 0.75036985), (-3.3326187, -0.80709684, 2.0596714), (-3.3326187, 0.8070958, 2.0596714), (-3.928988, -4.5004202e-7, 0.75036985), (-0.26224098, -3.418915, 2.0596714), (-1.7974297, -2.9201026, 2.0596716), (-1.2141238, -3.7366898, 0.75036985), (3.1705444, -1.3059092, 2.0596714), (2.2217462, -2.6118186, 2.0596716), (3.178618, -2.3094013, 0.75036985), (2.746229, 0, 2.908303), (1.3731145, 0, 3.7569344), (0.8486313, 2.611819, 2.9083028), (0.4243157, 1.3059096, 3.7569344), (1.964494, 1.4272885, 3.178618), (-2.221746, 1.6141926, 2.908303), (-1.110873, 0.8070963, 3.7569344), (-0.75037, 2.309401, 3.178618), (-2.2217457, -1.614193, 2.9083028), (-1.110873, -0.8070966, 3.7569344), (-2.4282484, -3.375315e-7, 3.178618), (0.8486318, -2.611819, 2.908303), (0.4243159, -1.3059095, 3.7569344), (-0.75036967, -2.3094013, 3.178618), (1.9644942, -1.4272884, 3.178618)] + texCoord2f[] primvars:map1 = [(1, 0.5), (0.83810407, 0.67620814), (0.088104114, 0.8237918), (0.1762082, 0.5), (0.088104114, 0.17620823), (0.8381041, 0.32379177), (0.6762082, 0.5), (0.58810407, 0.82379186), (0.3381041, 0.67620814), (0.3381041, 0.32379177), (0.5881041, 0.17620823), (0.5, 0.5), (0.017899446, 0.6058617), (0.045186203, 0.7264708), (0.95424384, 0.5646707), (0.89617395, 0.63222325), (0.97984457, 0.8262766), (0.8858042, 0.7604919), (0.96310407, 0.69591326), (0.055768747, 0.5), (0.12043945, 0.5), (0.15830879, 0.60586166), (0.13102199, 0.7264708), (0.088104114, 0.61613977), (0.017899446, 0.3941383), (0.04518624, 0.27352917), (0.13102199, 0.27352917), (0.15830879, 0.39413828), (0.088104114, 0.38386026), (0.95424384, 0.43532932), (0.89617395, 0.36777675), (0.8858042, 0.23950814), (0.97984457, 0.1737234), (0.96310407, 0.30408674), (0.83810407, 0.5646707), (0.83810407, 0.4353293), (0.89617395, 0.5), (0.79040396, 0.7604919), (0.6963637, 0.82627666), (0.088104114, 0.9353294), (0.58810407, 0.9353294), (0.8381041, 0.8838603), (0.19636367, 0.8262766), (0.290404, 0.76049185), (0.22196433, 0.5646706), (0.2800342, 0.6322232), (0.21310408, 0.69591326), (0.22196433, 0.4353293), (0.2800342, 0.36777675), (0.19636367, 0.1737234), (0.290404, 0.23950806), (0.21310408, 0.30408674), (0.088104114, 0.06467063), (0.5881041, 0.06467063), (0.79040396, 0.23950814), (0.6963637, 0.17372333), (0.83810407, 0.11613975), (0.78003424, 0.36777675), (0.72196436, 0.4353293), (0.78003424, 0.63222325), (0.72196436, 0.5646707), (0.7800342, 0.5), (0.631022, 0.7264709), (0.65830874, 0.6058617), (0.7131041, 0.6959133), (0.38580418, 0.76049185), (0.4798445, 0.8262766), (0.33810407, 0.8838603), (0.33810407, 0.4353293), (0.33810407, 0.5646706), (0.2800342, 0.49999994), (0.47984457, 0.17372333), (0.3858042, 0.23950806), (0.3381041, 0.11613967), (0.65830874, 0.3941383), (0.631022, 0.27352923), (0.7131041, 0.3040867), (0.6204394, 0.5), (0.5557687, 0.5), (0.5451862, 0.7264709), (0.51789945, 0.6058617), (0.5881041, 0.61613977), (0.39617398, 0.63222325), (0.45424387, 0.5646707), (0.4631041, 0.69591326), (0.39617398, 0.36777675), (0.45424387, 0.4353293), (0.39617395, 0.5), (0.5451862, 0.27352917), (0.51789945, 0.3941383), (0.4631041, 0.3040867), (0.5881041, 0.38386026), (1.0178994, 0.6058617), (1.0451862, 0.7264708), (1.0881041, 0.8237918), (1.0557687, 0.5), (1.0178994, 0.3941383), (1.0451863, 0.27352917), (1.0881041, 0.17620823), (1.0881041, 0.9353294), (1.0881041, 0.06467063)] ( + interpolation = "faceVarying" + ) + int[] primvars:map1:indices = [0, 92, 14, 92, 93, 18, 92, 18, 14, 14, 18, 15, 93, 94, 16, 93, 16, 18, 18, 16, 17, 18, 17, 15, 15, 17, 1, 0, 95, 92, 19, 20, 23, 19, 23, 12, 12, 23, 13, 20, 3, 21, 20, 21, 23, 23, 21, 22, 23, 22, 13, 13, 22, 2, 0, 96, 95, 24, 25, 28, 24, 28, 19, 19, 28, 20, 25, 4, 26, 25, 26, 28, 28, 26, 27, 28, 27, 20, 20, 27, 3, 0, 29, 96, 29, 30, 33, 29, 33, 96, 96, 33, 97, 30, 5, 31, 30, 31, 33, 33, 31, 32, 33, 32, 97, 97, 32, 98, 0, 14, 29, 14, 15, 36, 14, 36, 29, 29, 36, 30, 15, 1, 34, 15, 34, 36, 36, 34, 35, 36, 35, 30, 30, 35, 5, 1, 17, 37, 17, 16, 41, 17, 41, 37, 37, 41, 38, 16, 94, 99, 16, 99, 41, 41, 99, 40, 41, 40, 38, 38, 40, 7, 2, 22, 42, 22, 21, 46, 22, 46, 42, 42, 46, 43, 21, 3, 44, 21, 44, 46, 46, 44, 45, 46, 45, 43, 43, 45, 8, 3, 27, 47, 27, 26, 51, 27, 51, 47, 47, 51, 48, 26, 4, 49, 26, 49, 51, 51, 49, 50, 51, 50, 48, 48, 50, 9, 98, 32, 100, 32, 31, 56, 32, 56, 100, 100, 56, 53, 31, 5, 54, 31, 54, 56, 56, 54, 55, 56, 55, 53, 53, 55, 10, 5, 35, 57, 35, 34, 61, 35, 61, 57, 57, 61, 58, 34, 1, 59, 34, 59, 61, 61, 59, 60, 61, 60, 58, 58, 60, 6, 1, 37, 59, 37, 38, 64, 37, 64, 59, 59, 64, 60, 38, 7, 62, 38, 62, 64, 64, 62, 63, 64, 63, 60, 60, 63, 6, 2, 42, 39, 42, 43, 67, 42, 67, 39, 39, 67, 40, 43, 8, 65, 43, 65, 67, 67, 65, 66, 67, 66, 40, 40, 66, 7, 3, 47, 44, 47, 48, 70, 47, 70, 44, 44, 70, 45, 48, 9, 68, 48, 68, 70, 70, 68, 69, 70, 69, 45, 45, 69, 8, 4, 52, 49, 52, 53, 73, 52, 73, 49, 49, 73, 50, 53, 10, 71, 53, 71, 73, 73, 71, 72, 73, 72, 50, 50, 72, 9, 5, 57, 54, 57, 58, 76, 57, 76, 54, 54, 76, 55, 58, 6, 74, 58, 74, 76, 76, 74, 75, 76, 75, 55, 55, 75, 10, 6, 63, 77, 63, 62, 81, 63, 81, 77, 77, 81, 78, 62, 7, 79, 62, 79, 81, 81, 79, 80, 81, 80, 78, 78, 80, 11, 7, 66, 79, 66, 65, 84, 66, 84, 79, 79, 84, 80, 65, 8, 82, 65, 82, 84, 84, 82, 83, 84, 83, 80, 80, 83, 11, 8, 69, 82, 69, 68, 87, 69, 87, 82, 82, 87, 83, 68, 9, 85, 68, 85, 87, 87, 85, 86, 87, 86, 83, 83, 86, 11, 9, 72, 85, 72, 71, 90, 72, 90, 85, 85, 90, 86, 71, 10, 88, 71, 88, 90, 90, 88, 89, 90, 89, 86, 86, 89, 11, 10, 75, 88, 75, 74, 91, 75, 91, 88, 88, 91, 89, 74, 6, 77, 74, 77, 91, 91, 77, 78, 91, 78, 89, 89, 78, 11] +} + +def Mesh "pPlatonic2" ( + references = +) +{ + rel material:binding = + double3 xformOp:translate = (-8, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] +} + +def Mesh "pPlatonic3" ( + references = +) +{ + rel material:binding = + double3 xformOp:translate = (8, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] +} + +over "MaterialX" +( + references = [@./standard_surface_jade.usda@, + @./standard_surface_gold.mtlx@] +) +{ +} + +def Scope "Looks" +{ + def Material "standardSurface2SG" + { + string inputs:file1:varname = "map1" + string inputs:file2:varname = "map1" + string inputs:file3:varname = "map1" + token outputs:mtlx:surface.connect = + + def Shader "standardSurface2" + { + uniform token info:id = "ND_standard_surface_surfaceshader" + float inputs:base = 1 + color3f inputs:base_color.connect = + float inputs:emission.connect = + color3f inputs:emission_color = (0.4709, 0.3034, 0) + float inputs:metalness.connect = + float3 inputs:normal.connect = + float inputs:specular_roughness.connect = + token outputs:surface + } + + def NodeGraph "MayaNG_standardSurface2SG" + { + color3f outputs:baseColor.connect = + float outputs:emission.connect = + float outputs:metalness.connect = + float3 outputs:normalCamera.connect = + float outputs:specularRoughness.connect = + + def Shader "file1" + { + uniform token info:id = "ND_image_color3" + color3f inputs:default = (0.5, 0.5, 0.5) + asset inputs:file = @../textures/Brazilian_rosewood_pxr128.png@ + float2 inputs:texcoord.connect = + string inputs:uaddressmode = "periodic" + string inputs:vaddressmode = "periodic" + color3f outputs:out + } + + def Shader "MayaGeomPropValue_file1" + { + uniform token info:id = "ND_geompropvalue_vector2" + string inputs:geomprop.connect = + float2 outputs:out + } + + def Shader "file2" + { + uniform token info:id = "ND_image_color3" + color3f inputs:default = (0.5, 0.5, 0.5) + asset inputs:file = @../textures/RGB.png@ ( + colorSpace = "Raw" + ) + float2 inputs:texcoord.connect = + string inputs:uaddressmode = "periodic" + string inputs:vaddressmode = "periodic" + color3f outputs:out + } + + def Shader "MayaGeomPropValue_file2" + { + uniform token info:id = "ND_geompropvalue_vector2" + string inputs:geomprop.connect = + float2 outputs:out + } + + def Shader "MayaSwizzle_file2_r" + { + uniform token info:id = "ND_swizzle_color3_float" + string inputs:channels = "r" + color3f inputs:in.connect = + float outputs:out + } + + def Shader "MayaSwizzle_file2_g" + { + uniform token info:id = "ND_swizzle_color3_float" + string inputs:channels = "g" + color3f inputs:in.connect = + float outputs:out + } + + def Shader "file3" + { + uniform token info:id = "ND_image_color3" + color3f inputs:default = (0.5, 0.5, 0.5) + asset inputs:file = @E../textures/normalSpiral.png@ ( + colorSpace = "Raw" + ) + float2 inputs:texcoord.connect = + string inputs:uaddressmode = "periodic" + string inputs:vaddressmode = "periodic" + color3f outputs:out + } + + def Shader "MayaGeomPropValue_file3" + { + uniform token info:id = "ND_geompropvalue_vector2" + string inputs:geomprop.connect = + float2 outputs:out + } + + def Shader "MayaConvert_file3_color3f_float3" + { + uniform token info:id = "ND_convert_color3_vector3" + color3f inputs:in.connect = + float3 outputs:out + } + + def Shader "MayaNormalMap_standardSurface2_normalCamera" + { + uniform token info:id = "ND_normalmap" + float3 inputs:in.connect = + float3 outputs:out + } + + def Shader "MayaSwizzle_file2_b" + { + uniform token info:id = "ND_swizzle_color3_float" + string inputs:channels = "b" + color3f inputs:in.connect = + float outputs:out + } + } + } +} diff --git a/test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_gold.mtlx b/test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_gold.mtlx new file mode 100644 index 0000000000..912c3d123d --- /dev/null +++ b/test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_gold.mtlx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_jade.usda b/test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_jade.usda new file mode 100644 index 0000000000..910c5cd264 --- /dev/null +++ b/test/lib/mayaUsd/fileio/UsdImportMaterialX/standard_surface_jade.usda @@ -0,0 +1,118 @@ +#usda 1.0 +( + customLayerData = { + string colorSpace = "lin_rec709" + } + doc = """Generated from Composed Stage of root layer +""" +) + +def "MaterialX" +{ + def "Materials" + { + def Material "Jade" + { + float inputs:base = 0.5 + color3f inputs:base_color = (0.0603, 0.4398, 0.1916) + float inputs:coat + float inputs:coat_affect_color + float inputs:coat_affect_roughness + float inputs:coat_anisotropy + color3f inputs:coat_color + float inputs:coat_IOR + float3 inputs:coat_normal + float inputs:coat_rotation + float inputs:coat_roughness + float inputs:diffuse_roughness + float inputs:emission + color3f inputs:emission_color + float inputs:metalness + float3 inputs:normal + color3f inputs:opacity + float inputs:sheen + color3f inputs:sheen_color + float inputs:sheen_roughness + float inputs:specular + float inputs:specular_anisotropy = 0.5 + color3f inputs:specular_color + float inputs:specular_IOR = 2.418 + float inputs:specular_rotation + float inputs:specular_roughness = 0.25 + float inputs:subsurface = 0.4 + float inputs:subsurface_anisotropy + color3f inputs:subsurface_color = (0.0603, 0.4398, 0.1916) + color3f inputs:subsurface_radius + float inputs:subsurface_scale + float3 inputs:tangent + float inputs:thin_film_IOR + float inputs:thin_film_thickness + bool inputs:thin_walled + float inputs:transmission + color3f inputs:transmission_color + float inputs:transmission_depth + float inputs:transmission_dispersion + float inputs:transmission_extra_roughness + color3f inputs:transmission_scatter + float inputs:transmission_scatter_anisotropy + token outputs:mtlx:surface.connect = + + def Shader "ND_standard_surface_surfaceshader" + { + uniform token info:id = "ND_standard_surface_surfaceshader" + float inputs:base.connect = + color3f inputs:base_color.connect = + float inputs:coat.connect = + float inputs:coat_affect_color.connect = + float inputs:coat_affect_roughness.connect = + float inputs:coat_anisotropy.connect = + color3f inputs:coat_color.connect = + float inputs:coat_IOR.connect = + float3 inputs:coat_normal.connect = + float inputs:coat_rotation.connect = + float inputs:coat_roughness.connect = + float inputs:diffuse_roughness.connect = + float inputs:emission.connect = + color3f inputs:emission_color.connect = + float inputs:metalness.connect = + float3 inputs:normal.connect = + color3f inputs:opacity.connect = + float inputs:sheen.connect = + color3f inputs:sheen_color.connect = + float inputs:sheen_roughness.connect = + float inputs:specular.connect = + float inputs:specular_anisotropy.connect = + color3f inputs:specular_color.connect = + float inputs:specular_IOR.connect = + float inputs:specular_rotation.connect = + float inputs:specular_roughness.connect = + float inputs:subsurface.connect = + float inputs:subsurface_anisotropy.connect = + color3f inputs:subsurface_color.connect = + color3f inputs:subsurface_radius.connect = + float inputs:subsurface_scale.connect = + float3 inputs:tangent.connect = + float inputs:thin_film_IOR.connect = + float inputs:thin_film_thickness.connect = + bool inputs:thin_walled.connect = + float inputs:transmission.connect = + color3f inputs:transmission_color.connect = + float inputs:transmission_depth.connect = + float inputs:transmission_dispersion.connect = + float inputs:transmission_extra_roughness.connect = + color3f inputs:transmission_scatter.connect = + float inputs:transmission_scatter_anisotropy.connect = + token outputs:surface + } + } + } + + def "Shaders" + { + def Shader "ND_standard_surface_surfaceshader" + { + uniform token info:id = "ND_standard_surface_surfaceshader" + token outputs:surface + } + } +} \ No newline at end of file diff --git a/test/lib/mayaUsd/fileio/testShaderReader.py b/test/lib/mayaUsd/fileio/testShaderReader.py index aff875bf62..82819b4974 100644 --- a/test/lib/mayaUsd/fileio/testShaderReader.py +++ b/test/lib/mayaUsd/fileio/testShaderReader.py @@ -152,8 +152,7 @@ def testMaterialXShaderReader(self): mayaUsdLib.ShaderReader.Register(mtlxShaderReaderTest, "ND_swizzle_color3_float") mayaUsdLib.ShaderReader.Register(mtlxShaderReaderTest, "ND_convert_color3_vector3") - usdFilePath = os.path.join(testShaderReader.inputPath, '..', '..', 'usd', 'translators','UsdImportMaterialX', - 'UsdImportMaterialX.usda') + usdFilePath = os.path.join(testShaderReader.inputPath, 'UsdImportMaterialX', 'UsdImportMaterialX.usda') cmds.usdImport(file=usdFilePath, shadingMode=['useRegistry','MaterialX' ])