From dc66271575f8a4e1539566f13b8027de4fe42681 Mon Sep 17 00:00:00 2001 From: "ADS\\lanierd" Date: Thu, 12 Dec 2024 15:51:32 +0100 Subject: [PATCH] HYDRA-1292 : Fix a freeze with Mtx openpbr deletion --- lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp b/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp index b69c5b829b..e807ab2b5d 100644 --- a/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp +++ b/lib/mayaHydra/hydraExtensions/adapters/materialAdapter.cpp @@ -263,7 +263,10 @@ class MayaHydraShadingEngineAdapter : public MayaHydraMaterialAdapter } // Construct a MaterialX document - auto mtlxDocStr = mtlxDocPlug.asString(); + const MString mtlxDocStr = mtlxDocPlug.asString(); + if (0 == mtlxDocStr.length()) { + return false; + } auto mtlxDoc = MaterialX::createDocument(); MaterialX::readFromXmlString(mtlxDoc, mtlxDocStr.asChar());