Animating a model
(Redirected from AddGesture())
Jump to navigation
Jump to search
This page is for programmers. Animators should see $sequence and/or Choreography creation.
Main Sequence
All CBaseAnimating
entities can play an animation.
SetSequence(int)
- Changes an entity's current skeletal animation sequence. If the sequence is already playing, and is not marked as a loop, it will restart.
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 sequences
If your entity inherits from CBaseAnimatingOverlay
you can blend up to 15 sequences on top of the standard one.
Tip:Layers are calculated each frame in order of
priority
.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)
- As
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.
CAnimationLayer* GetAnimOverlay(int)
- Directly access an animation layer. You will need to do this in order to kill one manually.
Networked animation
See m_PlayerAnimState
.
Choreography
Choreography is the playback of pre-authored acting scenes.
[Todo]
Facial expression
[Todo]