pygfx.objects.SkinnedMesh

class pygfx.objects.SkinnedMesh(geometry, material)

Bases: Mesh

A skinned mesh.

A mesh that has a Skeleton with bones that can then be used to animate the vertices of the geometry.

property bind_matrix

The base matrix that is used for the bound bone transforms.

property bind_matrix_inv

The base matrix that is used for resetting the bound bone transforms.

property bind_mode

How a skinned mesh is bound to its skeleton. Either “attached” or “detached”.

See pygfx.utils.enums.BindMode:. Default “attached”.

bind(skeleton: Skeleton, bind_matrix=None)

Bind a skeleton to the skinned mesh. The bind_matrix gets saved to .bind_matrix property and the .bind_matrix_inv gets calculated.

Parameters:
  • skeleton (Skeleton) – The skeleton created from the bones tree.

  • bind_matrix (np.ndarray, optional) – The base transform of the skeleton.

pose()

Reset the skinned mesh to the binding-time pose.

Examples

Skinned Mesh

Skinned Mesh

Detached Bind Mode

Detached Bind Mode