Page 1 of 1
How do I clear a channel of a bone?
Posted: Mon Jul 23, 2018 1:49 pm
by Lukas
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?
Re: How do I clear a channel of a bone?
Posted: Mon Jul 23, 2018 4:22 pm
by hayasidist
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
Re: How do I clear a channel of a bone?
Posted: Mon Jul 23, 2018 4:35 pm
by synthsin75
Re: How do I clear a channel of a bone?
Posted: Mon Jul 23, 2018 7:11 pm
by Lukas
Thanks for the help guys.
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)
Because
here it says Name: "fAnimScale" = Type: "AnimVal" and I didn't realise I could use those AnimChannel methods on it. (:
Re: How do I clear a channel of a bone?
Posted: Mon Jul 23, 2018 7:42 pm
by hayasidist

yeah - totally forgot about clear
