Notifications
Clear all

[Closed] Recreate Group Header once it is deletes by mistake?

Hy scriptgods and max-halfgods!

Is there a possibility to recreate group headers once they are deleted? I have that case that someone deleted some headers during the process.

any ideas :shrug: ?

hope there is light at the end of the tunnel…

thanks in advance

anselm

4 Replies

Funilly enough I’ve been working on grouping this week!

You can set any object to be a group head from my discoveries, then you set other objects as group members, then set the new members to be children of the group head.

Some test code:

b = box()
setGroupHead b true
for i = 1 to 5 do
 (
 s = sphere pos:(random [-100,-100,-100] [100,100,100])
 setGroupMember s true
 append b.children s
 )

Hope that helps.

hy dave! tested your assembly! worked fine with a demo scene…

but what if i allready have objects that once belonged to a group (with a deleted header )?

how can i pick or select objects with the selection floater and ad them to a group? any ideas?

thanks in advance

anselm

Just script it. Select your objects and run:

gpMembers = $
 
gpHead = dummy pos:gpMembers.center name:"New Group"
setGroupHead gpHead true
 
for obj in gpMembers do
(
setGroupMember obj true
append gpHead.children obj
)

Hy Dave again!

i modiefied your script bits a little…the paradise edition of this script would be a menu with a “Pick” button where you can select lost group members by choice


b = box()
setGroupHead b true
for i = 1 to 1 do
 (
 s = Dummy pos:([000,000,000])
 setGroupMember s true
 append b.children s
 $Box01.name = "RepearedGroup"
 )


regards

anselm