ParentSkeleton() important tip! Update the bone matrix

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

ParentSkeleton() important tip! Update the bone matrix

Post by heyvern »

Good grief. It took me ages to figure this out.

When accessing the skeleton of the selected layer you would use:

Code: Select all

moho:Skeleton()
When you want to access the bones in the parent skeleton of a sub layer you would use:

Code: Select all

moho:ParentSkeleton()
Now you move bones around with your script and want to update everything:

Code: Select all

moho:Skeleton():UpdateBoneMatrix()
Oops! This doesn't update the PARENT SKELETON! To do that you need an additional update:

Code: Select all

moho:ParentSkeleton():UpdateBoneMatrix()
This may be obvious to many of you... but it had me pulling out what's left of my hair trying to figure out why the script wasn't working. ;)

-vern
Post Reply