I'm trying to make some selection shelf buttons, specifically for selecting limbs, or fingers or the like... by clicking on a control object and have the active selection extend to include the hierarchy. e.g. clicking on the wrist might select metacarpals and all the fingers. clicking on the knuckle would select the remaining finger joints of that finger. I also want to limit this to only include visible objects in the viewport... so I don't select IK controls while in FK mode, or vice versa.
I tried the MEL select command with various flagcombinations, -hi -vis -a -r; none seems to do what I want or expect the button to do.
how can I do this properly?
Replies
What you can do is use the name to check for visibility before doing the selection. I'm gonna use joint1 as example here with Python.
cmds.getAttr('joint1.visibility') <--- return True if visibility is on. With this condition, the select command will only be call if joint1 is visible.