The AnimChannel class is the base class for all animation channels in Moho. You never use this class directly, but it provides various functions that are useful for working with any kind of animation channel.
Member Functions
int ChannelType()
Returns the type of animation channel you're working with. See the channel types.
Return value (int): the type of animation channel
int CountKeys()
Returns the number of keyframes in the channel.
Return value (int): the number of keyframes in the channel
int Duration()
Returns the duration of the animation channel (basically, the time of the last keyframe).
Return value (int): the duration of the animation channel
void Clear()
Clears a channel, removing all keyframes.
Return value: none
void StoreValue()
Stores the current value as a keyframe. Each type of channel has a member variable called "value". If you change the value variable then call this function, you will add a new keyframe at the current time.
Return value: none
void AddKey(when)
Adds a new keyframe at the given frame.
Return value: none
when (int): frame number
void Reset(when)
Sets the value at a given frame to be the same as the value at frame 0.
Return value: none
when (int): frame number
bool HasKey(when)
Tests whether the channel has a keyframe at a given frame.
Return value (bool): true if a keyframe exists, otherwise false
when (int): frame number
int GetClosestKeyID(when)
Returns the closest keyframe to the given frame. If the given frame has a key, then that keyframe is returned.
Return value (int): the closest keyframe id
when (int): frame number
void DeleteKey(when)
Deletes a keyframe at the specified frame.
Return value: none
when (int): frame number
void SetKeyInterp(when, interpMode, val1, val2)
Sets the interpolation mode at a specified frame. See the available interpolation mode constants.
Return value: none
when (int): frame number
interpMode (int): interpolation mode
val1 (float): supplemental value 1
val2 (float): supplemental value 2
void SetKeyInterpByID(id, interpMode, val1, val2)
Sets the interpolation mode for a specified keyframe. See the available interpolation mode constants.
Return value: none
id (int): keyframe id
interpMode (int): interpolation mode
val1 (float): supplemental value 1
val2 (float): supplemental value 2