What is a good way in mel to query if a group is selected?

What is a good way in mel to query if a group is selected?

malcolm_341
Collaborator Collaborator
402 Views
1 Reply
Message 1 of 2

What is a good way in mel to query if a group is selected?

malcolm_341
Collaborator
Collaborator

Is there a robust way to check if my selection is a group? I see you can check if the transform has a shape node or not, that doesn't seem that robust though, is there any kind of type command that will return group?

0 Likes
Accepted solutions (1)
403 Views
1 Reply
Reply (1)
Message 2 of 2

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

As far as I know, there isn't.

Maya doesn't differentiate between "transform" and "group", by definiton a "group" is only a "transform" without a shape node.

 So if you filter for type "transform" when you check your selection and then check for objects that don't have a immediate child node of type "shape", you should reliably only end up with groups.

 

So the method you came up with yourself is robust.

 

I hope this helps!