Hi
I’m looking for some help with binding MaterialX based hdnetwork to my sceneindex
I’ve this mtlx document successfully converted to a hdDataSource as below:
Note: I’m setting the HdMaterialSchema::BuildRetained to use mtlx
instead of HdMaterialSchemaTokens->universalRenderContext
[mtlx]
[nodes]
[/MaterialX/Materials/USD_Plastic/ND_UsdPreviewSurface_surfaceshader]
[inputConnections]
[nodeIdentifier]
ND_UsdPreviewSurface_surfaceshader
[parameters]
[diffuseColor]
[value]
(0.10470402, 0.24188282, 0.818)
[ior]
[value]
1.5
[roughness]
[value]
0.32467532
[terminals]
[surface]
[upstreamNodeOutputName]
surface
[upstreamNodePath]
/MaterialX/Materials/USD_Plastic/ND_UsdPreviewSurface_surfaceshader
I’m adding it to my sceneindex as below:
pxr::SdfPath materialId("/MaterialX/Materials/USD_Plastic");
retainedScene->AddPrims({ { materialId, TfToken("materials"), mtlxdata } });
My Scene Index contents are:
/ ()
/teapot ()
/teapot/lid (mesh)
@mesh:
@topology:
@faceVertexCounts: [...]
@faceVertexIndices: [...]
@holeIndices: []
@orientation: rightHanded
@primvars:
@points:
@primvarValue: [...]
@indices: []
@interpolation: vertex
@role: point
@normals:
@primvarValue: [...]
@indices: []
@interpolation: vertex
@role: normal
@displayColor:
@primvarValue: (1, 0, 0)
@indices: []
@interpolation: constant
@role: color
@materialBindings:
@:
@path: /MaterialX/Materials/USD_Plastic
/teapot/body (mesh)
@mesh:
@topology:
@faceVertexCounts: [...]
@faceVertexIndices: [...]
@holeIndices: []
@orientation: rightHanded
@primvars:
@points:
@primvarValue: [...]
@indices: []
@interpolation: vertex
@role: point
@normals:
@primvarValue: [...]
@indices: []
@interpolation: vertex
@role: normal
@displayColor:
@primvarValue: (1, 0, 0)
@indices: []
@interpolation: constant
@role: color
@materialBindings:
@:
@path: /MaterialX/Materials/USD_Plastic
/MaterialX ()
/MaterialX/Materials ()
/MaterialX/Materials/USD_Plastic (materials)
@mtlx:
@nodes:
@/MaterialX/Materials/USD_Plastic/ND_UsdPreviewSurface_surfaceshader:
@parameters:
@diffuseColor:
@value: (0.10470402, 0.24188282, 0.818)
@ior:
@value: 1.5
@roughness:
@value: 0.32467532
@inputConnections:
@nodeIdentifier: ND_UsdPreviewSurface_surfaceshader
@terminals:
@surface:
@upstreamNodePath: /MaterialX/Materials/USD_Plastic/ND_UsdPreviewSurface_surfaceshader
@upstreamNodeOutputName: surface
I’m unable to get mtlx shaders to work. Looking at HydraBrowser I see the same datasource layout
Any ideas what I’m missing here?