Animating a model

From Valve Developer Community
Revision as of 21:43, 15 September 2011 by Artfunkel (talk | contribs) (Created page with "'''<code>CBaseAnimating::SetSequence()</code>''' changes an entity's current skeletal animation sequence. If the sequence is already playing, and is not marked as a [[$sequen...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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.
SelectWeightedSequence(Activity)
Selects an appropriate sequence for the given activity.
int LookupActivity(char*)
int LookupSequence(char*)
Gets an activity or sequence by name.
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.
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.