Animating a model
Jump to navigation
Jump to search
CBaseAnimating::SetSequence()
changes an entity's current skeletal animation sequence. If the sequence is already playing, and is not marked as a loop, it will restart.
Related functions
SetSequenceByName(char*)
- Searches for a sequence by name. Avoid doing this if you can.
int SelectWeightedSequence(Activity)
- Selects an appropriate sequence for the given activity. Pass the return value to
SetSequence()
.
SetCycle(float)
- Changes the frame of the current sequence.
SetPlaybackRate(float)
- Changes the sequence's speed. The argument is a normalised percentage.
GetSequenceLinearMotion(int sequence, Vector* output)
- Gets a
Vector
which describes the sequence's extracted motion over its entire duration.
Blending
If your entity inherits from CBaseAnimatingOverlay
you can blend up to 15 sequences on top of the standard one.
int AddLayeredSequence(int sequence, int priority)
- Adds a new layer which plays the given sequence. Return value is the layer's index; check it with
IsValidLayer()
. 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.
int AddGesture(Activity activity, bool autokill = true)
- Helper which creates a layer with the given activity. Return value is the layer's index.
int FindGestureLayer(Activity activity)
- Finds a active layer playing the given activity. Returns -1 on failure.
SetLayerDuration(int layer, float duration)
- Adjusts the framerate of the given layer so that it lasts for the given number of seconds.
CAnimationLayer* GetAnimOverlay(int)
- Directly access an animation layer. You will need to do this in order to kill one manually.