From 4f4f98f7fec014f96d46a17055a488781cccc715 Mon Sep 17 00:00:00 2001 From: Pierre Baillargeon Date: Wed, 6 Apr 2022 16:47:23 -0400 Subject: [PATCH] MAYA-114603 use correct way to query attribute Use the correct mel command to querythe existence of an attribute. The new code avoids errors being printed in teh MEL console when the attribute does not exists. --- lib/mayaUsd/utils/loadRulesAttribute.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mayaUsd/utils/loadRulesAttribute.cpp b/lib/mayaUsd/utils/loadRulesAttribute.cpp index 7368f25a2d..a218f8c3db 100644 --- a/lib/mayaUsd/utils/loadRulesAttribute.cpp +++ b/lib/mayaUsd/utils/loadRulesAttribute.cpp @@ -33,7 +33,7 @@ bool hasLoadRulesAttribute(const MFnDependencyNode& depNode) { MString nodeName = depNode.absoluteName(); MString cmd; - cmd.format("addAttr -query -exists \"^2s.^1s\"", loadRulesAttrName, nodeName); + cmd.format("attributeQuery -exists -n \"^2s\" \"^1s\"", loadRulesAttrName, nodeName); int result = 0; const bool display = false;