Go to: Synopsis. Return value. Related. Flags. MEL examples.

Synopsis

setParticleAttr [-attribute string] [-floatValue float] [-object string] [-randomFloat float] [-randomVector float float float] [-relative boolean] [-vectorValue float float float] selectionList

setParticleAttr is undoable, NOT queryable, and NOT editable.

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.

Return value

None

Related

getParticleAttr, particle

Flags

attribute, floatValue, object, randomFloat, randomVector, relative, vectorValue
Long name (short name) Argument types Properties
-attribute(-at) string create
Tells the action which attribute you want to set
-floatValue(-fv) float create
Tells what you want the value to be set to of a float attribute
-vectorValue(-vv) float float float create
Tells what you want the value to be set to of a vector attribute
-randomFloat(-rf) float create
Tells the command to add a random value from -FLOAT to +FLOAT to the results of each particle. The default is 0.0.
-randomVector(-rv) float float float create
Tells the command to add a random value from <<-x,-y,-z>> to <<x,y,z>> to the results of each particle. The default 0 0 0.
-relative(-r) boolean create
If this is set to TRUE (the default is FALSE), then the float or vector value will be added to the current value for each particle.
-object(-o) string create
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 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.

MEL examples

setParticleAttr -at velocity -vv 1 2 3 particle1;
// This will set the velocity of all of the particles in particle1
// to << 1, 2, 3 >>.
select particleShape1.pt[0:7] particleShape1.pt[11];
setParticleAttr -vv 1 2 3 -at velocity; or setParticleAttr -at velocity particleShape1;
// 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.