Page 1 of 1

Get Selected Bones

Posted: Mon Oct 19, 2015 3:11 pm
by ernpchan
How does one get the selected bones? My guy can get selected Layers but he can't figure out how to get the selected bones.

Thx.

Re: Get Selected Bones

Posted: Mon Oct 19, 2015 4:13 pm
by dkwroot
Tell your code guy that he has to iterate through a bone layer and check each bone for the selected one.

Code: Select all

Layer = moho.layer
for i in Layer:Skeleton:CountBones()-1 do
   Bone = Layer:Skeleton:Bone(i)
   if Bone.fSelected then
      --DO CODE HERE
   end
end

Re: Get Selected Bones

Posted: Mon Oct 19, 2015 4:18 pm
by ernpchan
Thank you!