Go to:
Return value. Related commands. Flags. Examples.
Synopsis
skinPercent [flags] [skinCluster node name] [object components]
This command edits and queries the weight values on members of a
skinCluster node. If no object components are explicitly mentioned
in the command line, the current selection list is used.
Note that setting multiple weights in a single invocation of
this command is far more efficient than calling it once per
weighted vertex.
Return value
none
Related commands
bindPose, bindSkin, blendShape, boneLattice, copyFlexor, copySkinWeights, flexor, skinCluster, wire, wrinkleFlags
ignoreBelow, normalize, pruneWeights, relative, resetToDefault, transform, transformValue, value
| Long name (short name) | [argument types] | Properties |
|---|
-value
(-v)
| |  |
|
Returns an array of doubles corresponding to the
joint weights for the selected object component.
|
|
-transform
(-t)
| string |  |
|
If used after the -query flag (without an argument)
the command returns an array of strings corresponding to
the names of the transforms influencing the selected object
components. If used before the -query flag (with a
transform name), the command returns the weight of the
selected object component corresponding to the given
transform.
|
|
-transformValue
(-tv)
| string double |   |
|
Accepts a pair consisting of a transform name and a value
and assigns that value as the weight of the selected
object components corresponding to the given transform.
|
|
-relative
(-r)
| boolean |   |
|
Used with -transformValue to specify a relative setting of values.
If -relative is true, the value passed to -tv is added to the
previous value. Otherwise, it replaces the previous value.
|
|
-ignoreBelow
(-ib)
| double |  |
|
Limits the output of the -value and -transform queries
to the entries whose weight values are over the specified
limit. This flag has to be used before the -query flag.
|
|
-normalize
(-nrm)
| boolean |  |
|
If set, the weights not assigned by the -transformValue
flag are normalized so that the sum of the all weights
for the selected object component add up to 1. The default
is on. NOTE: The skinCluster has a normalizeWeights attribute
which when false overrides this attribute! If the
skinCluster.normalizeWeights attribute is false, you must
set it to true in order to normalize weights using the
skinPercent command.
|
|
-resetToDefault
(-rtd)
| |  |
|
Sets the weights of the selected components to their
default values, overwriting any custom weights.
|
|
-pruneWeights
(-prw)
| double |  |
|
Sets to zero any weight smaller than the given value for
all the selected components. To use this command to set
all the weights to zero, you must turn the -normalize flag
"off" or the skinCluster node will normalize the weights
to sum to one after pruning them. Weights for influences with
a true value on their "Hold Weights" attribute will not
be pruned.
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can be used more than once in a command
|
Examples
// For cv[100], set the weight wrt joint1 to 0.2, the weight
// wrt joint3 to 0.8 and adjust the remaining weights to keep
// the overall weight normalized (i.e. set all other joints to zero,
// since the weights we are setting sum to 1.0)
//
skinPercent -transformValue joint1 0.2 -transformValue
joint3 0.8 skinCluster1 shape.cv[100];
// Get the names of the transforms which influence cv[100] with
// a weight of at least 0.5
//
skinPercent -ignoreBelow 0.5 -query -transform skinCluster1
shape.cv[100];
// Get the actual weight values corresponding to the above
// transforms
//
skinPercent -ignoreBelow 0.5 -query -value skinCluster1 shape.cv[100];
// Get the weight of cv[100] corresponding to joint3
//
skinPercent -transform joint3 -query skinCluster1 shape.cv[100];
// Normalize the existing weights for cv[100]
//
skinPercent -normalize on skinCluster1 shape.cv[100];
// Reset the weights for cv[100] to their default values
//
skinPercent -resetToDefault skinCluster1 shape.cv[100];
// Zero all the weights that are below 0.1
//
skinPercent -pruneWeights 0.1 shape;
// Zero all the weights
//
skinPercent -pruneWeights 100 -normalize off shape;
// Assign weights to a large number of vertices,
// several at a time to reduce the number of calls
// to the skinPercent command.
//
for ( $i = 0; $i <= 9901; $i += 10 ) {
skinPercent -transformValue joint1 0.5
-transformValue joint2 0.5 skinCluster1
pSphere1.vtx[$i] pSphere1.vtx[$i+1] pSphere1.vtx[$i+2]
pSphere1.vtx[$i+3] pSphere1.vtx[$i+4] pSphere1.vtx[$i+5]
pSphere1.vtx[$i+6] pSphere1.vtx[$i+7] pSphere1.vtx[$i+8]
pSphere1.vtx[$i+9];
}