How do I clear a specific channel of a bone?
I've specified a bone, and now I want to clear the Scale-channel of just that bone (in a lua function). But...how?
How do I clear a channel of a bone?
Moderators: Víctor Paredes, Belgarath, slowtiger
- hayasidist
- Posts: 3514
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: How do I clear a channel of a bone?
from what you say, you have the relevant M_Bone class?
this should do it -- or at least get you in the right direction..
get M_Bone:fAnimScale which is the AnimChannel for scale.
get MohoDoc:EndFrame()
then iterate for when = endFrame until 0
AnimChannel:DeleteKeyByID(AnimChannel:GetClosestKeyID(when)); when = when - 1
hth
this should do it -- or at least get you in the right direction..
get M_Bone:fAnimScale which is the AnimChannel for scale.
get MohoDoc:EndFrame()
then iterate for when = endFrame until 0
AnimChannel:DeleteKeyByID(AnimChannel:GetClosestKeyID(when)); when = when - 1
hth
- synthsin75
- Posts: 9970
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How do I clear a channel of a bone?
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: How do I clear a channel of a bone?
Thanks for the help guys.
The whole time I was looking for something like:
Because here it says Name: "fAnimScale" = Type: "AnimVal" and I didn't realise I could use those AnimChannel methods on it. (:
Man, I was staring at that page for an hour, completely clueless on how to do it... Thanks for the example!
The whole time I was looking for something like:
Code: Select all
local channel = bone:getscalechannelsomehow() -- obviously not
channel:Clear(0)
- hayasidist
- Posts: 3514
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: How do I clear a channel of a bone?
yeah - totally forgot about clear