ScriptSpot

Forum topic · General Scripting

Select all parents for an object

By cledus_ · 2010-10-18

Description

Hi all!

Is there a way to select all parents to an object?

Have a great day!

Comments (2)

cledus_ · 2010-10-21

Hi Insanto!

You are absolutely right. Thats what I want. I will check your script out.

Thank you so much for your help!

Graph · 2010-10-18

as an object can only have one parent in max i guess you want to walk up through the chain and collect everything on your way there?!


(
	fn add2Arr obj arra=(if isValidNode obj and isValidNode obj.parent do(append arra obj.parent;add2Arr obj.parent arra))

	local arr = #()
	add2Arr selection[1] arr
	
	print (arr as string)
)