Hi there,
I am building a tool for popping up attributes on the selected node. I could use some help with the filtering - there are so many types, compounds, arrays compounds of arrays etc. In the image below - I want to gather the simple compounds like translate, which is working fine on a transform node, however if on a shape node, all the complex attributes are messing things up, I am trying to filter them out in a way that is automatic, rather than having to specify an ignore list.
I am finding it difficult to understand the complexity of the multi, array, compounds and how to filter them. Are there any good articles on the web to improve my knowledge. I have been looking at Maya native scripts for Channel Control etc to help. I am using methods like ignoring ā.ā and ā[ā in the attribute names but it keeps tripping up as I try it on different nodes.
I suppose pointing to learning material on attributes would be the best help? So I can do a bit of research and come back to this and make the tool more robust.
$AED_ATT_LIST= `listAttr -multi $sel`;
for ($a in $AED_ATT_LIST) {
if (`gmatch $a "*\\[*"`) {print $a; continue;}
if (`gmatch $a "*.*"`)continue;
if( `objExists ($sel+"."+$a)`== 0) continue;
if(`attributeQuery -node $sel -usesMultiBuilder $a`){
print ("skipping multiBuilder = "+ $a);
continue;
}
if(`attributeExists $a $sel`==0){
print ($sel+"."+$a + "attribute doesn't exist or not found");
continue;
}
// Keep if it has no parent (standalone scalar)
// OR if it IS a parent (has children) like translate
string $parent[] = `attributeQuery -node $sel -listParent $a`;
int $numChildren[] = `attributeQuery -node $sel -numberOfChildren $a`;
if (size($parent) == 0 || size($numChildren) > 0) {
$result[size($result)] = $a;
}
}
