Group Attaching

Tell me please, I just want to make the same operation like simple attach group tool! I need to use this:

attachNodesToGroup

I know that I can use

on atachbtn click do 
( 
   attachNodesToGroup selection <targetNode> 
) 

but how to define targetnode that will be a group? It means that selection should be attached to the picked group=>finally it will be a group as well! How to pick a group by script? Thx in advance!

on atachbtn picked obj do 
( 
   if isValidNode obj AND isGroupHead obj do 
   print obj.name 
)

doesn't work for me

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

This is funny work around

Try this
select some objects that you want to attach then run code below and pick any group member

fn getGrandParentName obj = (while obj.parent != undefined do obj = obj.parent)
fn groupFilt o = (isGroupMember o)
if selection.count != 0 do
(
	grpMember = pickObject count:1 filter:groupFilt rubberBand:selection.center rubberBandColor:yellow
	if isValidNode grpMember do 
	( 
		if isGroupHead (grpHead = getGrandParentName grpMember) do attachNodesToGroup selection grpHead
	)
)

bga

artrender.info's picture

oh! Barigazy connected

so nice to see you here!!!

barigazy's picture

:)

Yup. I'm here and just finish my new tool and post it on "Scripts" page.
Whole day I try to find a bug and finaly "seed" function is the main reason for the lost time. Thanks to Kostadin (miauuu) and DenisT problem are solved.

bga

artrender.info's picture

ow great

let's see

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.