Can anyone offer insight to working with the InterpSetting class? I'm trying to write a tool for myself to be able to apply certain easing settings that I frequently use to selected keyframes with a single tool button click. My stumbling block is in setting Bezier curve parameters ... I know what values the parameters should have but I can't figure out how to apply them to a keyframe using code.
According to the documentation for the AnimChannel class, the SetKeyInterp() method can be called in two ways -- by passing an integer Interpolation Method (like 2 for Ease In/Out) or an instance of the InterpSetting class. The first way works as expected, but in order to set Bezier curve parameters you need to use the second way.
The documentation for the InterpSetting class lists several methods -- SetBezierInAngle(), SetBezierInPercentage(), SetBezierOutAngle(), SetBezierOutPercentage() -- that look to provide the solution but they each require two parameters: component, and angle or percentage. I know what angle and percentage ought to be, but what is the component parameter?
Help with InterpSetting class
Moderators: Víctor Paredes, Belgarath, slowtiger
- hayasidist
- Posts: 3830
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Help with InterpSetting class
it's been a while since I used this, but IIRC, "component" has meaning in an anim channel that has multiple dimensions -- so x, y, z in a Vec3 are the components (and I can't recall if they are referred to as 1,2,3 or 0,1,2)
hope that at least moves you forward.
(oh - and when you find out, please let me know and I'll update the scripting website with "the answer"!)
hope that at least moves you forward.
(oh - and when you find out, please let me know and I'll update the scripting website with "the answer"!)
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Help with InterpSetting class
Yeah, the component is the axis, starting from 0 (I checked some of my previous scripting).
- 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/
- hayasidist
- Posts: 3830
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Help with InterpSetting class
oh yeah -- eventually dug out one of my old scripts ... as Wes says - x is 0 etc.
There are constants defined for the axes: LM.X_AXIS, LM.Y_AXIS, LM.Z_AXIS which should "future-proof" your script just in case the axis numbers ever change (it's very rare but not unknown for "constants" to be different in different Moho version)
There are constants defined for the axes: LM.X_AXIS, LM.Y_AXIS, LM.Z_AXIS which should "future-proof" your script just in case the axis numbers ever change (it's very rare but not unknown for "constants" to be different in different Moho version)
Re: Help with InterpSetting class
Thanks for the insight! Setting that parameter to 0|1|2 did the trick. (Now I have a new InterpSetting question, somewhat related but different enough to merit a new thread....)