Notifications
Clear all

[Closed] script controller

Group is a thing, not a node. Technically the Group is a collection of nodes combined by special rules. There are a root node there (head), and its children (members). Head and member are nodes.
So when we say “to put group” into a variable, we should say about putting all members of Group as an array, or a head as a node.

delete objects 

pp = #()
for z = -1 to 1 by 2 do
	for y = -1 to 1 by 2 do
		for x = -1 to 1 by 2 do append pp (point name:(uniquename #p numdigits:1) size:20 pos:(10*[x,y,z]) wirecolor:yellow)
	
gr = group pp name:"eight_points"

mm = for node in gr where isgroupmember node collect node	
hh = for node in gr where isgrouphead node collect node	
gh = for node in gr where isgrouphead node do exit with node	

(	
	format "\n"	

	format "(pp) source nodes:\n\t%\n" (for p in pp collect p.name)
	format "(gr) group nodes:\n\t%\n" (for n in gr collect n.name)
	format "(mm) group memebers:\n\t%\n" (for m in mm collect m.name)
	format "(hh) group heads:\n\t%\n" (for h in hh collect h.name)

	format "\n"	

	format "\(gr) group head:\n\t\t%\n" gr
	format "\thead children:\n\t\t%\n" (for n in gr.children collect n)
)	

gr – is the grouphead node variable
it’s the same as $eight_points

It’s the answer I was looking for, Group is a thing, not a node!
With this information I have the free way to move forward.

Page 2 / 2