This command sets percent values on members of a weighted node such as a cluster or a jointCluster. With no flags specified the command sets the percent value for selected components of the specified node to the specified percent value. A dropoff from the specified percent value to 0 can be specifed from a point, plane or curve using a dropoff distance around that shape. The percent value can also be added or multiplied with existing percent values of the node components. In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
addPercent (ap) | bool | ||
|
|||
dropoffAxis (dax) | float, float, float | ||
|
|||
dropoffCurve (dc) | unicode | ||
|
|||
dropoffDistance (dds) | float | ||
|
|||
dropoffPosition (dp) | float, float, float | ||
|
|||
dropoffType (dt) | unicode | ||
Specifies the type of dropoff. Used in conjunction with the -dp, -dax or -dc flags. Default is linear. Valid values are: linear, sine, exponential, linearSquared, none. |
|||
multiplyPercent (mp) | bool | ||
Multiply the percent value specified with the -v flag with existing percent valuesFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
value (v) | float | ||
|
Derived from mel command maya.cmds.percent
Example:
import pymel.core as pm
import maya.cmds as cmds
# set percents on the selected items to 0.6
#
pm.percent( 'cluster1', v=0.6 )
# set percents on the selected items dropping off along the
# z-axis starting at the origin. Dropoff distance is 5, and
# the initial value is 1. Dropoff type is linear.
#
pm.percent( 'cluster1', dp=(0, 0, 0), dax=(0, 0, 1), dt='linear', dds=5, v=1 )
# set percents on the selected items dropping off along
# curve1. Dropoff distance is 5, and
# the initial value is 0.3.
#
pm.percent( 'cluster2', dc='curve2', dds=3, v=0.3 )
# add 0.1 to the percents of the selected items
#
pm.percent( 'cluster1', v=0.1, ap=True )