global GetBoneArray
struct GetBoneArray
(
RootBone=#(),
fn selRootBone =
(
sel_Array=selection as Array
for sel_obj in sel_Array where findItem sel_Array (sel_obj.parent)==0 do append RootBone sel_obj
select RootBone
),
fn getChildren theNode =
(
nodeArray = #()
for obj in theNode.children do
(
append nodeArray obj
join nodeArray (getChildren obj)
)
return nodeArray
),
ChildrenBone=#(),
fn GetAllChildrenBone=
(
for i in RootBone do ChildrenBone +=getChildren i
),
allBone=#(),
fn GetAllBone=
(
allBone=RootBone+ChildrenBone
)
)
GetBoneArray=GetBoneArray()
GetBoneArray.selRootBone()
GetBoneArray.GetAllChildrenBone()
GetBoneArray.GetAllBone()