Enveloping

From Valve Developer Community
(Redirected from Envelope)
Jump to: navigation, search

Stub

This article or section is a stub. You can help by adding to it.

Enveloping, better known as skinning, is the process of associating a model's Mesh vertices with the bones Bones in its Skeleton. When the skeleton articulates, the mesh's vertices will follow the specific bone(s) they are associated with, thus deforming the mesh to attain a different pose. When a vertex is associated with more than one bone, the influence of each bone on the vertex can be relatively weighted against each other.

Tip.pngTip:Don't confuse the vertex weighting/skinning process with $weightlists.

Guidelines

Quick start
For a Rigid model the model editor's SMD exporter should create a rootbone and envelope your mesh to it automatically. If you need to realign the mesh's Position in relation to its placementOrigin, this can be done in QC; see $autocenter.
Editable data
The envelope and weightmap data is configured in a model editor and exported to the mesh's SMD triangles block.
Parentbone
Every vertex in the mesh must be assigned to a specific Parentbone. The bone's index is used rather than its name, so if there is only one bone the parentbone is always "node 0".
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 convex hulls 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