Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-114603 use correct way to query attribute #2260

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

pierrebai-adsk
Copy link
Collaborator

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.

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.
@pierrebai-adsk
Copy link
Collaborator Author

TY Sean for seeing the issue and suggesting the fix! As a punishment, you review it. :)

@@ -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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. FYI, you don't really lines 39/40 as the default value for both these args is false.

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Apr 7, 2022
@seando-adsk seando-adsk added the workflows Related to in-context workflows label Apr 7, 2022
@seando-adsk seando-adsk merged commit 6614844 into dev Apr 7, 2022
@seando-adsk seando-adsk deleted the t_bailp/MAYA-114603/correct-attr-existence branch April 7, 2022 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants