Thanks a lot!! I'm not very familiar with OpenMaya api, is this the easiest
way to do it?

Also do you know a similar filter from the api but to get only connected
attrs? thanks in advance!

#supposing you have a node selected
import maya.OpenMaya as om
import maya.cmds as cmds

attributes = cmds.listAttr()
nodo = cmds.ls(sl=1)[0]

for x in attributes:
    referenceNode=om.MObject()
    selectionList=om.MSelectionList()
    selectionList.add(str(nodo))
    selectionList.getDependNode(0, referenceNode)
    referenceNodeMFn=om.MFnDependencyNode(referenceNode)
    editsPlug=referenceNodeMFn.findPlug(str(x))
    attrCommands = []
    editsPlug.getSetAttrCmds(attrCommands, om.MPlug.kNonDefault, True)
    if attrCommands != []:
        print 'nonDefault Value Attribute: ' + str(nodo) + '.' +
str((attrCommands[0].split()[1]).strip('".'))

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to