Go to: Synopsis. Return value. Related. Flags. Python examples.
getParticleAttr(
selectionItem
, [array=boolean], [attribute=string], [object=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
getParticleAttr is undoable, NOT queryable, and NOT editable.
This action will return either an array of values, or the average value and maximum offset, for a specied per-particle attribute of a particle object or component. If a particle component is specified on the command line, values are returned for that component only. If an object name is given instead, values are returned for all particles in that object. If no object name is passed, but a particle object or component is selected, values are returned for the selection.If you list components, they must all be from the same particle object; the action ignores all objects after the first. Likewise if you list more than one object, the actiion will return values only for the first one.
| float[] |
| Long name (short name) | Argument types | Properties | ||
|---|---|---|---|---|
array(a)
|
boolean
|
|
||
|
||||
attribute(at)
|
string
|
|
||
|
||||
object(o)
|
string
|
|
||
|
||||
import maya.cmds as cmds cmds.getParticleAttr( 'particle1', at='velocity' ) # This will return the average velocity for the entire particle # object as well as the maximum offset from the average. cmds.getParticleAttr( 'particleShape1.pt[0:7]', 'particleShape1.pt[11]', at='velocity' ) # This will return the average velocity for particles 0-7 and 11 # as well as the maximum offset from the average. cmds.getParticleAttr( 'particleShape1.pt[0:7]', 'particleShape1.pt[11]', at='position', array=1 ) # This will return an array of 27 floats containing the position # values for the nine specified particles.