[Closed] Attach Group to Group
I’m trying to figure out how to add a group to another group without becoming independent objects.
I’m currently adding the members of one group to the main group, and then deleting the old grouphead and regrouping the members. But this is obviously awkward and retarded.
I was wondering if people had some functions they had written in the past such as:
fn attachTogroup arrayofobjects = ()
fn detachFromgroup arrayofobjects = ()
fn CurrentGrouphead arrayofobjects = ()
The last one is a second problem I’m having. If a group is inside of a group it looks like all of the groupheads get mixed up in one giant array. I must say, I’m all around very displeased with Max’s groups but I’m quite certain it’s due to my lack of understanding.
As I understand it a group is a bunch of objects all parented to an invisible dummy “grouphead”. So if I were to say “grouphead is member of a group true” and then “parent grouphead to big group” it should (along with all of its group members)?
If anybody wants to share some grouping wisdom I will take any insight offered on any group subjects.
Ok as I figured I was doing everything totally wrong and ass backwards.
First two functions:
fn AttachGroup BigG LittleG=
(
append BigG.children LittleG
setgroupmember LittleG true
if isopengrouphead BigG == true then
(
setGroupopen BigG false
setGroupopen BigG true
)
else
(
setGroupopen BigG true
setGroupopen BigG false
)
)
fn AttachArray BigG ObjArray=
(
for i = 1 to ObjArray.count do
(
append BigG.children ObjArray[i]
setgroupmember ObjArray[i] true
)
if isopengrouphead BigG == true then
(
setGroupopen BigG false
setGroupopen BigG true
)
else
(
setGroupopen BigG true
setGroupopen BigG false
)
)
Ok here is what I wanted to do but I’ve decided is impossible due to the group architecture now that I understand it.
+Big Group
-SubGroup01
-SubGroup02
parent SubGroup02 -> SubGroup01
but the act of parenting makes SubGroup02 envelope SubGroup01 into its group. Which is not at all the behavior I want and I believe is unavoidable. It would be nice if you could group several groups and then have a hierarchy within the group. I take it this is impossible?
If you really want to do that I would script your own tool with a Point helper as the group objects. Set the size based on the Point helpers children min/max. This is similar to how Maya handles groups and how some grouping script out there work. Add a open/close CA to the helper. When closed freeze all the children, when open unfreeze the children. Then do whatever you want from there.
Hope that helps,
-Eric
Hmmm so write my own grouping code essentially. But then I would lose the whole point of the group wouldn’t I (Visible as only one object when closed)?
Slightly off topic: is there a better way to refresh a group the opening and closing it? If you don’t refresh it, Max doesn’t recognize the addition of group members. Is there a simple “refresh” sort of built in function which would be less code and cleaner?