This article's documentation is for anything that uses the Source engine. Click here for more information.

$boneflexdriver: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''$boneflexdriver''' is a QC command which enables [[vertex animation]].
{{This is a|name=$boneflexdriver|QC command}} It enables driving a flex with a bone's animation. This is particularly useful in multiplayer games where you can't pack VDC files into the map, as you can still use flex animation. It is also critical to [[vertex animation]].


== Availability ==
This command is available in the [[Source 2013]] branch and further.


* [[Source Filmmaker]]
{{note|Bone flex drivers will only work in-game on entities that support flex animation. E.g. [[generic_actor]], [[cycler_flex]], [[player]] or other NPCs.}}
* [[Dota 2]]


== Syntax ==
== Syntax ==


Source 2013:
<syntaxhighlight lang=php>
$boneflexdriver <bone_name> <graph_axis> <flex_name> <min> <max>
</syntaxhighlight>
Alien Swarm and later:
<syntaxhighlight lang=php>
<syntaxhighlight lang=php>
$boneflexdriver <bone_name> <graph_axis> <flex_name> <start_offset> <time_factor>
$boneflexdriver <bone_name> <graph_axis> <flex_name> <start_offset> <time_factor>
Line 15: Line 19:
: The name of an existing bone that will host vertex animation for this model.
: The name of an existing bone that will host vertex animation for this model.
; graph_axis
; graph_axis
: One of two values:
: One of three values:
:; <code>tx</code>  
:; <code>tx</code>  
:: Links the target flex controller to the weight of the animation (much like a [[skeletal animation]]'s). Normally set to 1.0.
:: Source 2013: Controls the flex controller by the X-axis animation of the bone.
:: Alien Swarm and Later: Also links the target flex controller to the weight of the animation (much like a [[skeletal animation]]'s).
:; <code>ty</code>
:; <code>ty</code>
:: Links the target flex controller to the current frame of vertex animation. Normally increases from 0 to 1.0 over time.
:: Source 2013: Controls the flex controller by the Y-axis animation of the bone.
:: Alien Swarm and Later: Also links the target flex controller to the current frame of vertex animation.
:; <code>tz</code>
:: Source 2013: Controls the flex controller by the Z-axis animation of the bone.
:: Alien Swarm and Later: Unknown function.
; flex_name
; flex_name
: The name of the flex controller this command operates on. There are two sensible options:
: The name of the flex controller this command operates on.  
: In Alien Swarm and later, there are two sensible options:
:* <code><vca_name></code> (for tx)
:* <code><vca_name></code> (for tx)
:* <code>multi_<vca_name></code> (for ty)
:* <code>multi_<vca_name></code> (for ty)
: In both cases, <code><vca_name></code> is the name of the model's [[vcafile]] minus any file extension.
: In both cases, <code><vca_name></code> is the name of the model's [[vcafile]] minus any file extension.
; min
: Minimum weight value of the controller.
; max
: Maximum weight value of the controller.
; start_offset
; start_offset
: Adds a delay before the vertex animation starts.
: Adds a delay before the vertex animation starts.
Line 32: Line 46:
== Example ==
== Example ==


The command should be used twice:
For [[Vertex animation|vertex animation]]:


<syntaxhighlight lang=php>
<syntaxhighlight lang=php>
Line 38: Line 52:
$boneflexdriver "flexAnimBone" ty "multi_my_vca_name" 0 1
$boneflexdriver "flexAnimBone" ty "multi_my_vca_name" 0 1
</syntaxhighlight>
</syntaxhighlight>
[[Category:QC Commands|b]]

Latest revision as of 21:08, 16 July 2025

$boneflexdriver is a QC command available in all Source Source games. It enables driving a flex with a bone's animation. This is particularly useful in multiplayer games where you can't pack VDC files into the map, as you can still use flex animation. It is also critical to vertex animation.

This command is available in the Source 2013 branch and further.

Note.pngNote:Bone flex drivers will only work in-game on entities that support flex animation. E.g. generic_actor, cycler_flex, player or other NPCs.

Syntax

Source 2013:

$boneflexdriver <bone_name> <graph_axis> <flex_name> <min> <max>

Alien Swarm and later:

$boneflexdriver <bone_name> <graph_axis> <flex_name> <start_offset> <time_factor>
bone_name
The name of an existing bone that will host vertex animation for this model.
graph_axis
One of three values:
tx
Source 2013: Controls the flex controller by the X-axis animation of the bone.
Alien Swarm and Later: Also links the target flex controller to the weight of the animation (much like a skeletal animation's).
ty
Source 2013: Controls the flex controller by the Y-axis animation of the bone.
Alien Swarm and Later: Also links the target flex controller to the current frame of vertex animation.
tz
Source 2013: Controls the flex controller by the Z-axis animation of the bone.
Alien Swarm and Later: Unknown function.
flex_name
The name of the flex controller this command operates on.
In Alien Swarm and later, there are two sensible options:
  • <vca_name> (for tx)
  • multi_<vca_name> (for ty)
In both cases, <vca_name> is the name of the model's vcafile minus any file extension.
min
Minimum weight value of the controller.
max
Maximum weight value of the controller.
start_offset
Adds a delay before the vertex animation starts.
time_factor
The keyframe rate of the animation is multiplied by this value. It doesn't actually change the animation's duration however, making it of little use.

Example

For vertex animation:

$boneflexdriver "flexAnimBone" tx "my_vca_name" 0 1
$boneflexdriver "flexAnimBone" ty "multi_my_vca_name" 0 1