Animating a model
CBaseAnimating entities can play an animation.
- Changes an entity's current skeletal animation sequence. If the sequence is already playing, and is not marked as a loop, it will restart.
- Searches for a sequence by name. Avoid doing this if you can.
- Selects an appropriate sequence for the given activity. Pass the return value to
- Changes the frame of the current sequence.
- Changes the sequence's speed. The argument is a normalised percentage.
GetSequenceLinearMotion(int sequence, Vector* output)
- Gets a
Vectorwhich describes the sequence's extracted motion over its entire duration.
If your entity inherits from
CBaseAnimatingOverlay you can blend up to 15 sequences on top of the standard one.
int AddGesture(Activity activity, bool autokill=true)
- Helper which creates a layer with the given activity. Return value is the layer's index, or -1 on failure.
void RestartGesture(Activity activity, bool addifmissing=true, bool autokill=true)
- Resets the first layer playing the given activity to its first frame. Optionally creates a new layer with the gesture if nothing is found.
int FindGestureLayer(Activity activity)
- Searches for a active layer playing the given activity. Returns -1 on failure.
int AddGestureSequence(int sequence, bool autokill=true)
AddGesture(), but doesn't require an activity.
int AddLayeredSequence(int sequence, int priority)
- Directly adds a new layer and makes it play the given sequence. Return value is the layer's index, or -1 on failure. Will not autokill.
SetLayerAutokill(int layer, bool autokill)
- A layer, by default, persists after its sequence is over. Setting autokill causes it to be removed automatically (even if it loops) once it's through.
SetLayerDuration(int layer, float duration)
- Adjusts the framerate of the given layer so that it lasts for the given number of seconds.
- Directly access an animation layer. You will need to do this in order to kill one manually.
Choreography is the playback of pre-authored acting scenes.