rjSkinningTools.delinearWeights package

Module contents

De-linearize skin weights.

https://github.com/robertjoosten/rjSkinningTools/raw/master/delinearWeights/README.gif

Installation

Copy the rjSkinningTools folder to your Maya scripts directory

C:/Users/<USER>/Documents/maya/scripts

Usage

Display UI

import rjSkinningTools.delinearWeights.ui
rjSkinningTools.delinearWeights.ui.show()

Note

Delinear weights applies an easing algorithm to the skin weights. This tool is best used if skin weights have been copied from a low polygon source, when this is done sometimes it is very obvious that the weights are linearly divided between the vertices of the low polygon source. This tool will tween those weights.

Code

rjSkinningTools.delinearWeights.deLinearSkinWeights(vertices, method)

Loop over all of the provided vertices. Loop over all of the vertices and see if these vertices are deformed by a skin cluster. If this is the case, the weights will be de-linearized by the function provided. This function is found in the tweening module using getTweeningMethod().

Parameters:
  • vertices (list) – List of vertices
  • method (str) – De-linearization method
rjSkinningTools.delinearWeights.deLinearSkinWeightsOnSelection(method)

All of the selected vertices will be queried with the getSelectedVertices() function, these vertices will then be parsed to the deLinearSkinWeights() function that will process the weights.

Parameters:method (str) – De-linearization method
rjSkinningTools.delinearWeights.getIndexFromString(vtx)

Get the index from a component string.

param str vtx:Path to component
return:Index of component string
Return type:int
rjSkinningTools.delinearWeights.getSelectedVertices()
Get all of the selected vertices. If no component mode selection is made
all vertices of a selected mesh will be appended to the selection.
Returns:List of selected vertices
Return type:list of strings
rjSkinningTools.delinearWeights.getTweeningMethod(method)

Get the tweening method from a string, if the function doesn’t exists None will be returned.

Returns:Tweening function
Return type:func/None
rjSkinningTools.delinearWeights.splitByInfluences(weights, num)

Split a list of weights into the size of the number of influences.

param list weights:
 List of weights
param int num:Size of split
return:Index of component string
Return type:int