Skip to content

Commit

Permalink
[usdMtlx] Removing some unnecessary comments in UsdMtlxReader and rem…
Browse files Browse the repository at this point in the history
…oving use of deprecated GetConnectedSource() from FileFormat test

Fixes #1636

(Internal change: 2243217)
  • Loading branch information
klucknav authored and pixar-oss committed Jul 27, 2022
1 parent 161e225 commit 3aef451
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
15 changes: 0 additions & 15 deletions pxr/usd/usdMtlx/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,21 +1495,6 @@ _Context::AddShaderNode(const mx::ConstNodePtr& mtlxShaderNode)
return UsdShadeShader();
}

// XXX -- If the node def is implemented by a nodegraph we may need
// to reference that node graph instead of creating a
// UsdShadeShader. That will require other USD support for
// inline shaders.

// XXX -- At the moment it's not clear how we'll handle a nodedef
// backed by a nodegraph. Will it be opaque with the
// implementation known only to the shader registry? Or will
// using that shader cause the nodegraph to be added to the
// stage? In that case do we make a separate copy of the
// nodegraph for each use or reference a single instantation?
//
// Note that we don't have a efficient way to get the nodegraph
// that implements the nodedef here.

// Choose the name of the shader. In MaterialX this is just
// mtlxShaderNode->getName() and has no meaning other than to uniquely
// identify the shader. In USD to support materialinherit we must
Expand Down
9 changes: 5 additions & 4 deletions pxr/usd/usdMtlx/testenv/testUsdMtlxFileFormat.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def test_MultiBindInputs(self):
for inputName, source in inputToSource.items():
input = nodeGraph.GetInput(inputName)
self.assertEqual(input.HasConnectedSource(), True)
self.assertEqual(input.GetConnectedSource()[0].GetPath(), source)
self.assertEqual(
input.GetConnectedSources()[0][0].source.GetPath(), source)

def test_MultiOutputNodes(self):
"""
Expand All @@ -159,9 +160,9 @@ def test_MultiOutputNodes(self):

for path, connNodeName, connectionName in testInfo:
node = UsdShade.Shader.Get(stage, path)
conn = node.GetInput('in').GetConnectedSource()
self.assertEqual(conn[0].GetPrim().GetPath().name, connNodeName)
self.assertEqual(conn[1], connectionName)
conn = node.GetInput('in').GetConnectedSources()[0][0]
self.assertEqual(conn.source.GetPath().name, connNodeName)
self.assertEqual(conn.sourceName, connectionName)

def test_nodesWithoutNodegraphs(self):
"""
Expand Down

0 comments on commit 3aef451

Please sign in to comment.