View Full Version : copy complete group

05 May 2008, 11:26 AM
Hi all.

Does anyone know how to make a straight copy from a group?

I've got a group that contains 3 objects and has some user properties.
I need a function that copies this complete group and it's properties.

Thanks for all your help

05 May 2008, 08:34 AM
Basically what i do is, I have a collection of objects grouped together. (box01,box02) and a user property on the group itself.

If I select the whole group, it does copy everything but the grouphead dummy is turned into a dummy resulting in the group objects being ungrouped.

Regrouping is not really an option as I need to retain the rotational and scale data.

Just copying the grouphead results in a copy of the dummy again.

I've tried setting the dummy as a grouphead and appending the new objects as children but
that doesnt seem to work.

Thanks for any help

05 May 2008, 09:22 AM
This should do the trick.
maxOps.cloneNodes $

05 May 2008, 01:02 PM
wheyhey! Thank you very much.

12 December 2008, 05:59 AM
That worked great but I have another question. I am trying to randomly copy from an array of groups. How do I filter just the groups as a node from a selection? If, for instance I selected 5 groups manually, it would just be shown as a selection containing all of the elements of each group lumped in to one large array.

Thanks in advance for any help.

12 December 2008, 09:28 AM
Hi guys,

Maybe a function something along the lines of:

--Function return an array of objects to be moved from complex group hierarchies
fn GroupLeaders Arr =
Leaders = for o in Arr where ((o.parent == undefined or isopengroupmember o) and (not isOpenGroupHead o)) collect o
)--End of Function Group Leaders

Where "Arr" is an array of selected objects from something like "getcurrentselection()"

I havent had a chance to test this on 3DSMax, but I think it should pick out all the closed top group nodes. i.e if you have nested groups then it should just pick the very top level.... should ;)

Let us know if it helps, good luck!


CGTalk Moderation
12 December 2008, 09:28 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.