Weights are used to bind mesh vertices to one or more bones. When the bones are transformed, the vertices are also transformed. Weights allow bones to deform meshes automatically as the bones are manipulated. This makes animating complex mesh deforms as simple as animating the bones.
Other names for allowing bones to affect mesh vertices include blended skinning, linear blend skinning, multi-matrix skinning, skeletal subspace deformation, or sometimes simply "skinning". To avoid confusion with the unrelated skins feature in Spine, we use the name "weights" or "mesh weights".
Please note that weights are not available in Spine Essential.
To bind bones to a mesh, first select a mesh with any tool, then click
Bind in the
Weights view to enter
Click each bone to bind to the mesh, then exit
Bind mode by pressing
escape, or by clicking the
Bind button in the
Weights view. When
Bind mode is exited for the first time, weights are automatically computed as if the
Auto weighting button were pressed.
The bound bones appear in the
Weights view and each bone is assigned a color. Note some settings in the
Weights view are only available when the Weights tool is active.
To see the weights that were computed automatically,
Overlay can be checked.
The mesh is filled with the bone colors to show the influence of the bones on the vertices. Now when the bones are transformed, the vertices are affected and the image deforms.
Bones can be unbound by selecting them in the
Weights view and clicking
Remove. The unbound bones will no longer affect the mesh. If all bones are removed, the mesh will return to being affected only be the transform of the bone to which it is attached.
Update Bindings button on the
Weights view binds the current mesh vertices to the bones, discarding the old binding positions.
When bones are bound to a mesh, the mesh vertices are stored in relation to each bone. When the bone is moved, the vertices also move to stay in the same position relative to the bone. The bone weights determine how much each bone influences the vertices. For example, if the weight for a bone is 100%, the vertices will move with the bone exactly.
In some cases,
Update Bindings is not needed. For example, consider a skeleton with a long tail. The more an image is bent, the more it distorts, so it is best to start with an image near the center of the bending range. A long tail needs to bend a lot in both directions, so it's best to use a long, skinny rectangle, bound to bones and weighted.
However, it may look odd to have the tail perfectly straight in setup mode, so the bones can be rotated so the tail is bent in setup mode.
Since the bones were rotated to bend the tail, the bones are not the same as when the mesh was bound. This means that each bone wants the vertices to be in different positions, so when the mesh weights are adjusted, the vertices in setup mode will move. When this is not desirable,
Update Bindings can help.
When adjusting weights for the long tail after the bones have been rotated, the vertices will move. This is acceptable because the weights are being adjusted to improve how the tail bends, and it is not important that the setup pose keep an exact position.
Consider a different scenario: a skeleton with a weighted mesh for an arm. If the arm bones are rotated in setup mode to achieve the exact pose desired, then adjusting weights to fix how the arm bends in animations will move the vertices in setup mode, ruining the pose. In this case it makes sense to use
Update Bindings to set a new bind pose after rotating the arms. Then when the weights are changed, the vertices in setup mode will not move and the pose is preserved.
Each vertex gets a weight for each bone to determine the influence of the bones. While
Auto weighting is often sufficient, the
Weights tool can be used to manually adjust weights.
When a mesh is selected with the
Weights tool, small pie charts are shown to indicate the influence from each bone. The pies can be hidden by unchecking
When no vertices are selected, click and drag with the
Weights tool to box select. Additional vertices can be selected by holding
cmd on Mac), then clicking or dragging to box select. The selected vertices can be deselected by pressing
escape, or by clicking in any empty space.
To change weights for the selected vertices, first select a bone whose weight will increase or decrease. This can be done by clicking the bone in the
Weights view or in the editor area. Next, drag up or down in the editor area to change the weight for the selected vertices. The weight is changed by adding or subtracting from the current value. To set the weight to an absolute value, the
Weight slider in the
Weights view can be used.
When subtracting a bone's influence, the influence of any other bones on the vertex is increased. Conversely, when adding a bone's influence, the influence of any other bones on the vertex is decreased. It is almost always more intuitive to adjust weights only be adding influence.
When right click is used to switch to the last selected tool, the selection for the
Weights tool is saved. This enables switching to a transform tool, trying out the weights by manipulating the bones, then switching back to the
Weights tool to further adjust the weights without needing to change the selection.
Smooth button averages the weights of the selected vertices with their neighbors. The neighbors of a vertex are those connected by a hull edge (cyan) or manually created internal edge (orange). If no vertices are selected, all are affected.
Smooth spreads the influence of bones and can result in smoother deformations. It can be clicked multiple times to increasingly spread the weights.
Prune button removes weights below a threshold. When setting up weights, it is common to end up with some bones having a very small affect on some vertices, especially after using
Smooth. These weights are unlikely to make a visible difference but still cause vertex transforms to be calculated for those bones. Removing unnecessary weights reduces the number of vertex transforms needed to render the mesh.
Multiple meshes can be pruned by using the tree filters to show only meshes, then selecting all the meshes and clicking
When a mesh is selected with the Weights tool and
Overlay is checked, the mesh is filled with the bone colors to show the influence of the bones on the vertices. If
Selected is also checked, only colors for the selected vertices and selected bones are shown, the rest are shown as black. This can make it easier to see faint colors.
Selected is checked and
Overlay is not, the image can be seen instead of black.
Mesh weights cannot be keyed in animate mode, however the weights can still be adjusted. This is allowed for convenience, to more easily try out weights using different poses without affecting the setup pose. It can also be useful to manually adjust weights to fix a specific deformation problem in an animation. Adjusting weights in animate mode is identical to adjusting them in setup mode.
When adjusting weights in animate mode, it can be useful to disable
Auto Key. After adjusting the pose and weights, returning to the setup pose can be done by clicking anywhere in the timeline.
When a mesh overlaps itself, the order the mesh's triangles are drawn can be important. Triangles are sorted by first determining which bone has the highest influence on the triangle's vertices, then the order that the bones appear in the Weights view is used to determine which triangles are drawn on top of other triangles. Bones in the Weights view can be reordered by dragging.