Vertex animation: Difference between revisions
Narrygewman (talk | contribs) mNo edit summary |
(fixed up some vertex animation misconceptions) |
||
Line 1: | Line 1: | ||
'''Vertex animation''' is the keyframed animation of individual [[vertex|vertices]] of a mesh. It's good for very complicated motion like that of cloth, hair, or water. It | '''Vertex animation''' is the keyframed animation of individual [[vertex|vertices]] of a mesh. It's good for very complicated motion like that of cloth, hair, or water. It uses a flex controller bone to move the model through a series of flexes (one for each frame). | ||
Vertex animation was added in [[ | Vertex animation was added in [[Alien Swarm]] and is available in all games that branch from it, including [[Portal 2]], [[Counter-Strike: Global Offensive]], [[Source Filmmaker]], and [[Dota 2]]. | ||
{{todo|Check if vertex animation was actually added in L4D or L4D2}} | |||
{{bug|Using the [[$scale]] command breaks vertex animation.}} | |||
== Implementation == | == Implementation == | ||
{{TODO: CLEANUP! OUTDATED! }} | |||
# Create a vertex animation in your modelling tool. | # Create a vertex animation in your modelling tool. | ||
# Export a Vertex Cache file. Currently only the official Maya exporter can do this, and only to SMD. | # Export a Vertex Cache file. Currently only the official Maya exporter can do this, and only to SMD. | ||
# Add the <code>vcafile</code> command to your [[$model (QC)|$model]] block (see example below). | # Add the <code>vcafile</code> command to your [[$model (QC)|$model]] block (see example below). | ||
{{Note: DMX does not require a vertex cache file, so if you're using DMX ignore these two steps. The vertex animation data can be exported by Blender Source Tools to DMX.}} | |||
This produces two flex controllers named after your VCA file. The first defines the blend weight of the animation, the second (prefixed with <code>multi_</code>) defines the active frame. | This produces two flex controllers named after your VCA file. The first defines the blend weight of the animation, the second (prefixed with <code>multi_</code>) defines the active frame. | ||
Line 40: | Line 41: | ||
* [http://www.youtube.com/watch?v=0ZZ8xH_nvX0 A simple video showing the use of Vertex animation for cloth.] | * [http://www.youtube.com/watch?v=0ZZ8xH_nvX0 A simple video showing the use of Vertex animation for cloth.] | ||
* [http://www.youtube.com/watch?v=r5aV5C6kryU Example of vertex animation in Source Filmmaker.] | * [http://www.youtube.com/watch?v=r5aV5C6kryU Example of vertex animation in Source Filmmaker.] | ||
* [https://www.youtube.com/watch?v=cP3M0Vu-_7I&feature=youtu.be Example of vertex animation in Portal 2's HLMV.] | |||
== See also == | == See also == | ||
Revision as of 18:13, 21 January 2018
Vertex animation is the keyframed animation of individual vertices of a mesh. It's good for very complicated motion like that of cloth, hair, or water. It uses a flex controller bone to move the model through a series of flexes (one for each frame).
Vertex animation was added in Alien Swarm and is available in all games that branch from it, including Portal 2, Counter-Strike: Global Offensive, Source Filmmaker, and Dota 2.
Implementation
Template:TODO: CLEANUP! OUTDATED!
- Create a vertex animation in your modelling tool.
- Export a Vertex Cache file. Currently only the official Maya exporter can do this, and only to SMD.
- Add the
vcafile
command to your $model block (see example below).
This produces two flex controllers named after your VCA file. The first defines the blend weight of the animation, the second (prefixed with multi_
) defines the active frame.
A programmer can now control your animation. If you need to map the vertex animation to a standard animation sequence, perform these extra steps:
- Add a new bone which will drive the vertex animation. It doesn't need to have any vertices attached.
- Add two
$boneflexdriver
commands to bind your vertex animation to the new bone (see example). - Add at least one
$sequence
in which the new bone is animated in its X and Y axes. Its X position defines the blend weight of the vertex animation (0-1), and its Y position defines the frame of vertex animation (0-1).
Example
$model "body" "ref_mesh.smd" {
vcafile "vertex_animation.vta"
}
// Optional:
$boneflexdriver "flexAnimBone" tx "vertex_animation" 0 1
$boneflexdriver "flexAnimBone" ty "multi_vertex_animation" 0 1
$upaxis Y // currently flex driver sequences must be Y-up
$sequence "vertex_animation" "flexAnimBone_anim.smd"
Example Videos
- A simple video showing the use of Vertex animation for hair.
- A simple video showing the use of Vertex animation for cloth.
- Example of vertex animation in Source Filmmaker.
- Example of vertex animation in Portal 2's HLMV.