Enveloping

From Valve Developer Community
Revision as of 09:08, 7 May 2008 by Beeswax (talk | contribs) (Guidelines)
Jump to: navigation, search

Enveloping is the process of attaching a model's Mesh vertices to the appropriate Bones in its Skeleton. When the skeleton articulates, the envelope's vertices will move with it, and the polygons will stretch or compress around joints. The Weightmap defines the relative amount of stretch for each vertex.

Tip.png Tip: Don't confuse weightmaps with $weightlists.

Guidelines

Quick start
For a rigid model (ie just one bone) the model editor's SMD exporter should envelope your mesh automatically.
Editable data
The envelope and weightmap data is configured in a model editor and exported to the mesh's SMD triangles block.
Weightmap
For models with a jointed skeleton, each part of the mesh (a group of vertices) needs to be "parented" to the relevant bone. A given vertex can be attached to more than one bone, in which case the weightmap data is used to "blend" the vertex's position relative to both bone positions. Jointed Collision Model physboxes must not be enveloped to more than one bone, and so don't need any weightmap configuration data.
Bonemerge
Sub-models (eg w_weapons) and Sub-meshes must be enveloped to the skeleton of their parent model to ensure that they align, move and deform correctly. This is usually done using the Bonemerge method (see Creating worldmodels from viewmodels).

Tooltips