Sometimes it is required to invert or remap the weights for a deformer. You can either download a tool or write your own but there is a simpler solution with the given paint weights tool in Maya.
The formula for remapping a value in a given range oldMin to oldMax, to a new range newMin to newMax is the following:
This looks pretty scary to paint but it can be simplified for most of the cases. In case of inverting weights in the range zero to one, the new range becomes one to zero and the formula becomes:
or in general for a range from zero to n:
For adding and subtracting, the add function of the tool can be used. For multiplications and divisions, the scale function is the way to go. In order to support the negative weights that will be interim results in the operation, the min value attribute needs to be set to -1 and the max value to n. If applicable, the clamping values need to be set to +/-n as well. The flood button in the tool makes it easy to apply the operation to the whole object or the selected vertices.
Cheers
Comments