You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/pxr/usd/usdMtlx/reader.cpp b/pxr/usd/usdMtlx/reader.cpp
index 473a359ce..ad1ef85cd 100644
--- a/pxr/usd/usdMtlx/reader.cpp+++ b/pxr/usd/usdMtlx/reader.cpp@@ -434,8 +434,12 @@ _TypeSupportsColorSpace(const mx::ConstValueElementPtr& mxElem)
bool colorImageNode = false;
if (type == "filename") {
// verify the output is color3 or color4
- mx::ConstNodeDefPtr parentNodeDef =- _GetNodeDef(mxElem->getParent()->asA<mx::Node>());+ mx::ConstNodeDefPtr parentNodeDef;+ if (mxElem->getParent()->isA<mx::Node>()) {+ parentNodeDef = _GetNodeDef(mxElem->getParent()->asA<mx::Node>());+ } else if (mxElem->getParent()->isA<mx::NodeDef>()) {+ parentNodeDef = mxElem->getParent()->asA<mx::NodeDef>();+ }
if (parentNodeDef) {
for (const mx::OutputPtr& output : parentNodeDef->getOutputs()) {
const std::string &type = output->getType();
Should I open an official PR?
The text was updated successfully, but these errors were encountered:
JGamache-autodesk
changed the title
Crash referencing a MaterialX NodeDef/NodeGraph exposing a filename output
Crash referencing a MaterialX NodeDef/NodeGraph exposing a filename input
Sep 5, 2024
Description of Issue
USD crashes when referencing a MaterialX NodeDef/NodeGraph exposing a filename output.
Steps to Reproduce
usdcat ShadeTest.mtlx
orusdview ShadeTest.mtlx
ShadeTest.zip
Fix:
Should I open an official PR?
The text was updated successfully, but these errors were encountered: