Select the same controller across multiple namespaces?

Select the same controller across multiple namespaces?

madelinethz
Explorer Explorer
218 Views
4 Replies
Message 1 of 5

Select the same controller across multiple namespaces?

madelinethz
Explorer
Explorer

Hi, I was wondering if anyone has a script to achieve the above.

The use case would be, for example, I have 20 referenced copies of the same character rig "Mob" in my scene, so my outliner has Mob1, Mob2, Mob3, etc etc. I want to make the entire crowd of "Mob"s cheer in the exact same pose of having both arms up. Currently I have to go through one by one, finding and clicking on 20 identical controllers, and only then lift their arms up together.

 

I would like to be able to select "Mob1:WristL" controller, hit the script shelf button, and then it would automatically select "Mob2:WristL" "Mob3:WristL" and so on. Maybe it would also select other rigs with similar naming schemes (eg "MainCharacter:WristL") but I wouldn't mind; it's easier and more time efficient to deselect one or two outliers.

 

I am aware I could create a selection set so that I would only have to do this tedious thing of selecting all their arms once. But I want to be able to broadly apply this to any controller in any scenes in which I have any rigs I have multiple copies of.

 

I have tried searching for something similar but haven't had any luck.

 

Thanks in advance!

0 Likes
Accepted solutions (1)
219 Views
4 Replies
Replies (4)
Message 2 of 5

mcw0
Advisor
Advisor
Accepted solution

Select your "Mob1:WristL".  Then run the following.

string $sel[] = `ls -sl`;

string $parts[];

tokenize($sel[0], ":", $parts);

select -r ("*:"+$parts[1]);

Message 3 of 5

madelinethz
Explorer
Explorer

This worked a wonder! Thank you so much, you've saved me so much of a headache animating crowds!!

0 Likes
Message 4 of 5

stephenkmann
Collaborator
Collaborator

you can just type   

 *:WristL  in the selection input field and it will select all objects with that name 

0 Likes
Message 5 of 5

madelinethz
Explorer
Explorer

Oh, this is a handy thing to know. The script option mcw0 is much more convenient for my use case; but thank you for telling me this!

0 Likes