Clearly the coffee isn’t working today or I’m having a brain fart but I can’t seem to get this to work.
I want to write a script that can take different objects that are at different levels in hierarchies (the depth will be unpredictable from rig to rig) and check if ANY of the parent objects have their visibility turned off.
So I might have a hierarchy like this :
-group1
----- group2
----------- group3
---------------- objectToCheck
and I want to give the script the ‘objectToCheck’ and have it check its visibility AND all of the group nodes’ visibility.
But I’m stuck on just listing all of those groups given the ‘objectToCheck’
It seems to me from reading the docs that this should work :
string $objectParents[]=listRelatives -allParents "objectToCheck";
but it only gives me one object (group3) so I’m puzzled as to why the -allParents flag exists if it just gives the same result as -parent.
I expected -allParents would give… ALL parents (!) - in this case - group1,group2,group3
How do I get it to populate the $objectParents array with all of the parent groups ?
Cheers,
Brian