Get Selected Bones

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
ernpchan
Posts: 154
Joined: Thu Aug 13, 2015 7:18 pm
Contact:

Get Selected Bones

Post 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.
My opinions and comments do not represent those of my employer.
http://www.ernestpchan.com
http://www.zazzle.com/gopuggo
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Get Selected Bones

Post 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
ernpchan
Posts: 154
Joined: Thu Aug 13, 2015 7:18 pm
Contact:

Re: Get Selected Bones

Post by ernpchan »

Thank you!
My opinions and comments do not represent those of my employer.
http://www.ernestpchan.com
http://www.zazzle.com/gopuggo
Post Reply