[Maya] Is there a way to query any node's attributes' default value?

Hi, I was experimenting on Maya node hashing for some sort of variation fingerprint generator, and for some reason I need to know any given node attribute’s default value.

Is there any way to query it ? Like

cmds.attributeInfo(node="myNode", attribute="translateX", default=True)

Since so far I could not find a cmd to do this, what currently I can think of is using createNode to create same type of node that I want to lookup for, and delete it after I query all it’s attribute values.

Would be great if I can do this without creating an extra node. :slight_smile:

Hi davidlatwe!

I think not all attributes posses default values, but those who do can be queried with:

cmds.attributeQuery('myAttribute', node='myNode', listDefault=True)

Here is the link to the documentation: attributeQuery

Hope that helps :slight_smile:
Cheers Fabian

1 Like

Oh ! That could work, can’t believe I didn’t try that one.
Thanks @Fasbue :smiley: !