$sequence
Jump to navigation
Jump to search
Simple
<string|name>
- The name of the animation. Will appear in HLMV, Hammer, etc.
<string|Skeletal animation file>
- Path to the
$sequence
's source file. By including this, you tell studiomdl that you are using the simple version of the command.
frame <int|start frame> <int|end frame>
- Specifies a range of frames to extract from the source animation. Useful for trimming off frames not used in a particular animation.
- For example, if the source animation contains 80 frames but this animation should only play the last 30 frames, then
frames 50 80
will load only those frames.
- For example, if the source animation contains 80 frames but this animation should only play the last 30 frames, then
- Can also be used to extract a single frame of animation by making the start and end frames match.
frames
is an alias offrame
, and can be used interchangeably with it.Warning:All frame numbers used elsewhere in the sequence (e.g. animation events) are relative to
start frame
.
origin <float|x> <float|y> <float|z>
- Adjusts the position of the animation within its own local space.
angles <float|x> <float|y> <float|z>
- Adjusts the rotation of the animation within its own local space.
rotate <float|angle>
- Identical to
angles
, but it only rotates along the Z axis.
scale <float|scale>
- Multiplies the size of the skeleton in this sequence. Negative values are accepted.
reverse
Template:CSGO add- Reverses the animation.
loop
- Has three effects:
- Causes the sequence to repeat endlessly until stopped.
- Prevents the sequence from restarting if triggered while already playing.
- Causes studiomdl to perform some cleanup between the first and last frames.
hidden
- Prevents the $sequence from being listed in user interfaces. Useful for sequences which serve only as layers of others.
fps <float|frames per second>
- Override the framerate of the animation. If unspecified, defaults to
30
. Note:These are animation frames - not screen frames!
<string|motion extract axis>
- Movement animations are easier to create if the model actually moves forwards, but for playback in-game it must "walk on the spot". This command resolves the issue by stripping root bone translation from an animation. Accepted axes are:
- *X, Y, and Z
- *LX, LY and LZ - the root bone moves along the axis until the animation is half complete, then moves back to its original position.
Tip:You can extract motion from any combination of axes. Just put a space between each one.
- This command is also available on $animations.
activity <string|name> <float|weight>
- Links the sequence to an activity.
Tip:If an activity name starts with "ACT_" then the activity keyword can be removed. When ACT_ is seen, it is implicitly an activity.
- If more than one
$sequence
has the same activity, then theweight
specifies how likely this sequence is to be picked when that activity is called. The odds of any particular$sequence
playing is simply its weight over the sum of all other weights.- For example, if a
$sequence
namedswing_a
has a weight of 2, and another$sequence
namedswing_b
has a weight of 1, then there is a 2/3 chance forswing_a
to play instead ofswing_b
. Note:If there is only one sequence tied to the activity, then its weight is irrelevant.
- For example, if a
autoplay
- Makes the sequence play at all times, on top of any other animations, no matter what the model is doing. Good for blended breathing animations and other automated motion. If a model has multiple
autoplay
$sequences, they’re layered in the order that they appear in the QC.Warning:Don't use this for an animation that might be played normally, or you'll end up with it playing twice and the motion doubling up.
addlayer <string|other $sequence name>
- Play another sequence on top of this one. The animations begin and end together, so discrepancies in their total run time (framerate * number of frames) will proportionately affect the added layer's framerate, if applicable. The other $sequence doesn't have to be above the current one.
- This is generally used to add either
delta
-ed layers such as aim matrices or specially weighted layers that only affect specific bones. - The other
$sequence
can be declared ahead of time if it will be imported at runtime.
blendlayer <string|other $sequence name> <int|startframe> <int|peakframe> <int|tailframe> <int|endframe> [options...]
- Similar to
addlayer
, but the new sequence only plays over specified frames, and it accepts a number of options. - The animation starts at 0% intensity on
startframe
, reaches 100% intensity onpeakframe
, starts to fade away ontailframe
, and fully fades out onendframe
. - Options:
spline
- Instead of fading the layer linearly, fade it with a spline curve.
xfade
- The layer will only fade in and not back out.
poseparameter <string|name>
- Allows a pose parameter to control the fading of the layer instead of the parent
$sequence
's frame. When this option is present, the frame range is instead used to determine how the pose parameter's value should make the layer fade in/out.- Example:
blendlayer aimmatrix -1 0 0 1 poseparameter move_x
param value: -2.000 -1.500 -1.000 -00.80 -00.60 -00.40 -00.200 000.00 00.200 00.400 00.600 00.800 1.0000 1.5000 2.0000
layer weight: 0.000% 0.000% 0.000% 20.00% 40.00% 60.00% 80.00% 100.0% 80.00% 60.00% 40.00% 20.00% 0.000% 0.000% 0.000%
- These values will change when making use of the
spline
option, but will still start and end at the same time.
- Example:
noblend
- Causes
blendlayer
to ignore the fading in/out entirely, effectively allowing it to act likeaddlayer
but with a specific frame range. local
- Todo: Has something to do with changing how the layer blends, but it's not clear specifically what it changes.
Warning:Unless the blended sequence has the
realtime
option, the blended sequence's framerate will be adjusted relative to the parent sequence so that it starts onstartframe
and ends onendframe
. For example, if both the parent and blended sequences play at 30 frames per second and last for 30 frames, but the blended sequence only plays during frames 5 through 20 (a total of 15 frames, only half of its original length), then the blended sequence will play at 60 frames per second (twice its original framerate!) so that it can start on frame 5 and end on frame 20.
snap
- Remove all blending when transitioning to this animation. This is useful for reaction animations that are the result of sudden and violent changes in the model's state, such as a creature flinching or a weapon firing.
realtime
- Instead of playing the animation from its first frame whenever it's asked to play, the animation always plays relative to the global system clock. Useful for adding layers that shouldn't play at the same rate as their parent $sequence, such as breathing.
fadein <float|seconds>
- Override how long this animation spends fading in. Default is 0.2.
Note:
fadein 0
achieves the same effect assnap
, but HLMV will not recognize it as a snap when automatic blending is enabled, makingsnap
necessary.
fadeout <float|seconds>
- Override how long this animation spends fading out. Default is 0.2.
weightlist <string|weightlist name>
- Selects a $weightlist to apply to this sequence.
- If a default weightlist is used, this will override it with the specified weightlist for this animation.
localhierarchy <string|bone name> <string|new parent name> [range <int|startframe> <int|peakframe> <int|tailframe> <int|endframe>]
- Changes a bone's parent for this animation only. "" can be used to remove the parent of a bone.
- This is primarily useful for ensuring that a bone blends correctly. As an example, if a weapon is normally held in the right hand, but during this animation it's held in the left hand, it will blend as if it were being held by the right hand. This option can then be used to make it blend relative to the left hand instead, which will remove the jittering caused by blending.
range
is optional, and requires four frame numbers that specify how the hierarchy should be blended over the specified frames.Note:This does not affect animations during transitions, making
snap
necessary.
compress <int|frameskip>
- Skip a given amount of frames to reduce model file size
posecycle <string|pose parameter>
- Makes the specified pose parameter control the animation frame instead of the specific animation that should play in a blend sequence.