This action will set the value of the chosen attribute for every particle or selected component in the selected or passed particle object. Components should not be passed to the command line. For setting the values of components, the components must be selected and only the particle object’s names should be passed to this action. If the attribute is a vector attribute and the -vv flag is passed, then the three floats passed will be used to set the values. If the attribute is a vector and the -fv flag is pass and the -vv flag is not passed, then the float will be repeated for each of the X, Y, and Z values of the attribute. Similarly, if the attribute is a float attribute and a vector value is passed, then the length of the vector passed will be used for the value. Note: The attribute passed must be a Per- Particle attribute.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
attribute (at) | unicode | ||
|
|||
floatValue (fv) | float | ||
|
|||
object (o) | unicode | ||
If this flag is passed and the STRING is the name of a particle object’s transform or shape, then ONLY that object will be edited, ignoring the selection list or command line, and ALL of its particles’ values will be changed for the specified attribute. Flag can have multiple arguments, passed either as a tuple or a list. |
|||
randomFloat (rf) | float | ||
|
|||
randomVector (rv) | float, float, float | ||
|
|||
relative (r) | bool | ||
|
|||
vectorValue (vv) | float, float, float | ||
|
Derived from mel command maya.cmds.setParticleAttr
Example:
import pymel.core as pm
pm.setParticleAttr( 'particle1', at='velocity', vv=(1, 2, 3) )
# This will set the velocity of all of the particles in particle1
# to "" 1, 2, 3 "".
pm.select( 'particleShape1.pt[0:7]', 'particleShape1.pt[11]' )
pm.setParticleAttr( vv=(1, 2, 3), at='velocity' )
pm.setParticleAttr( 'particleShape1', at='velocity' )
# This will set the velocity of particles 0-7 and 11 of
# particleShape1 to "" 1, 2, 3 "". The rest of the particles are
# not changed.