skinning.utils.math.vector module

skinning.utils.math.vector.average_vector(vectors)

Get the average vector of the all of the provided vectors. All vectors will be added up and divided by the number of the provided vectors.

Parameters:vectors (list[OpenMaya.MVector]) –
Returns:Average vector
Return type:OpenMaya.MVector
skinning.utils.math.vector.smooth_vectors(vectors, connections, iterations=3)

Perform smoothing on the provided vectors based on a connections mapper. The position of the new vector is set based on the index of that vector and its connected vectors based on the connected indices. The new vector position is the average position of the connected vectors.

Parameters:
  • vectors (list[OpenMaya.MVector]) –
  • connections (dict) –
  • iterations (int) –
Returns:

Smooth vectors

Return type:

list[OpenMaya.MVector]