Dev:Source/Architecture/Vertex Groups

提供: wiki
< Dev:Source‎ | Architecture
2010年3月9日 (火) 19:18時点におけるwiki>Mindronesによる版 (moved Dev:Source/Blender/Architecture/Vertex Groups to Dev:Source/Architecture/Vertex Groups)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Disclaimer

The information here may not be correct. These are just my observations on what seems to be happening, based on the code. Hopefully it will be useful to someone, and help them avoid having to plough through the code to figure it out like I did. -- Aligorith (2007Aug16)




bDeformGroup

  • These structs are stored in a listbase, in the Object struct, under the defbase variable. (i.e. ob->defbase.first == first bDeformGroup)
  • Their only purpose is to act as a place to store the names of the vertex-groups.
  • When the name of vertex-group is known, use the index (offset) of the group in this list to use as a key, when finding whether a vertex belongs to a vertex group.

MDeformVert

  • Each vertex/cp in a Mesh/Lattice has one of these related to it.
  • dw points to an array of MDeformWeights, and totweight shows the number of elements in that array

MDeformWeight

  • MDeformWeight structs are used to show whether a vertex/cp belongs to a vertex group, and also the weight that that vert should be affected by, in this particular group.
  • The def_nr value is basically the index of a relevant vertex group. Compare this value with the index of a bDeformGroup, in order to determine if the vertex this MDeformWeight/MDeformVert represents is in that group.