[Closed] Selecting Groups ?
Is there a way to select Group Nodes
as in
If iskindof i GROUPClass then
(
–do something
)
I looked through the documentation. I noticed that the “Select by name” has a “Display Groups” filter…
Thanks in advance.
see mxs help:
Node Common Properties, Operators, and Methods [left]isGroupHead <node>
[/left]
[left]Returns true if node is group head, false otherwise.
[/left]
[left]
[/left]
[left]isOpenGroupHead <node>
[/left]
[left]Returns true if <node> is the head of a group, and that group is open.
[/left]
[left]
[/left]
[left]isGroupMember <node>
[/left]
[left]Returns true if node is in a group, false otherwise.
[/left]
[left]
[/left]
[left]isOpenGroupMember <node>
[/left]
[left]Returns true if <node> is a member of a group, and that group is open.
[/left]
I did see that. But it was not getting me what i was looking for. I think groups are a little quirky in Max, or at least my understanding of them is wrong. For example if I select a group either in the viewport or through the “select by name”. This creates a selection array of the object in the group plus the group object.
If I run:
–
[font=Courier New]isGroupHead $ – RETURNS – Runtime error: isGroupHead requires a node[/font]
–or
$.pos – RETURNS – Unknown property: “pos” in $selection
$.name – RETURNS – Unknown property: “name” in $selection
–
Now if I open the group, and select the Groups brackets and run the above I get no errors, and expected results. I now see that max treats a group as selection, where I thought the group object was a parent object.
I would still like to cycle through a scenes contents and do a bunch of stuff to the groups including accessing the name, position, and some other basic properties. Selecting all and opening everything seems potentially dangerous (nested groups come to mind).
Is there a way to select, and cycle through group objects without opening everything?
Thanks in advance.
select without opening – no
manipulate without selecting – yes
for x in objects where (isgrouphead x) do
(
whatever
)
I noticed you said “in Max” If this means you are from a package like Maya they are not the same thing. In Maya they are just another node in a hierarchy. In Max you can think of them like a container that can be opened and closed. If you are just looking for the Maya equivalent then use http://www.penproductions.ca/scripts/mGroup/mGroup.htm
Thanks for the replys. I think I will have to open the groups up to do what I need.
Pen, I am mainly a Max guy but I am aware of how other progams like maya handle groups… Unfortunatly our export pipeline is made to use native max groups. I did run across you mGroups script when I was exploring a solution.
Thanks again.