Vertex animation

From Valve Developer Community
Revision as of 03:41, 4 May 2014 by Artfunkel (talk | contribs) (Created page with "'''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 shoul...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 should not be confused with flex animation, which deforms a mesh from one shape to another by moving its vertices in straight lines.

Vertex animation was added in Source Filmmaker, and is also available in Dota 2.

Implementation

  1. Add a bone which will "host" the vertex animation.
  2. Create a vertex animation in your modelling tool.
  3. Export a Vertex Cache file. Currently only the official Maya exporter can do this, and only to SMD.
  4. Add the vcafile command to your $model block (see example below).
  5. Add two $boneflexdriver commands to bind your animation to your host bone (see example).
  6. Add at least one $sequence in which the flex host bone is animated in the 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"
}

$boneflexdriver "flexAnimBone" tx "vertex_animation" 0 1
$boneflexdriver "flexAnimBone" ty "multi_vertex_animation" 0 1

$sequence "vertex_animation" "flexAnimBone_anim.smd"

See also