pymel.core.effects.emit

emit(*args, **kwargs)

The emitaction allows users to add particles to an existing particle object without the use of an emitter. At the same time, it allows them to set any per-particle attribute for the particles that are created with the action.The particles created do not become a part of the initial state for the particle object, and will disappear when the scene is rewound unless they are saved into the initial state by the user explicitly. In addition, a particle object will accept particles from an emit action ONLY at frames greater than or equal to its start frame. For example, if you want to use the emit action to create particles at frame -5, you must set startFrame for that particle shape to -5 or less.Unlike many commands or actions, the emit action uses the order of its flags as important information as to how it works. The -objectand -positionflags can appear anywhere in the argument list. The -attributeand the value flags are interpreted based on their order. Any value flags after an -attribute flag and before the next -attribute flag will set the values for the attribute specified by the closest -attribute flag before them in the argument list. See the Examplessection below for more detail on how these flags work.Currently, no creation expression is executed for the new particles unless they are created from within a particle expression defined with the dynExpressioncommand or the Expression Editor. If you want any particular values put into the particles at the time they are created, then those values should be set using the -attribute, -vectorValue, and -floatValueflags.

Flags:
Long name (short name) Argument Types Properties
attribute (at) unicode ../../../_images/create.gif
 

Specifies the attribute on the particle object that any value flags following it and before the next -attribute flag will be associated with. The same attribute can be specified later in the command to pick up where the first one left off. The attributes used must be per-particle attributes. This will accept both long and short names for the attributes. Note the per-particle attribute must already exist on the particle object prior to being specified via this command flag.

floatValue (fv) float ../../../_images/create.gif
 

Sets the float value to be used for the currentattribute of the currentparticle. By current attribute, it is meant the attribute specified by the most recent -attribute flag. By current particle, it is meant the particle in the list of -position flags that corresponds to the number of values that have been set for the currentattribute. If the current attribute is a vector-per-particle attribute, then the float value specified will be used for all three components of the vector. Flag can have multiple arguments, passed either as a tuple or a list.

object (o) unicode ../../../_images/create.gif
 

This flag takes the name of a particleShape or the transform directly above it in the DAG as its parent. It specifies which object to add the particles to. This flag must be passed, as the selection list is ignored for this action.

position (pos) float, float, float ../../../_images/create.gif
 

Specifies the positions in the particle object’s space (usually world space) where the particles are to be created. One particle is created for each occurence of this flag.

vectorValue (vv) float, float, float ../../../_images/create.gif
 

Sets the vector value to be used for the currentattribute of the currentparticle. By current attribute, it is meant the attribute specified by the most recent -attribute flag. By current particle, it is meant the particle in the list of -position flags that corresponds to the number of values that have been set for the currentattribute. If the current attribute is a float-per-particle attribute, then the length of the vector described by this flag will be used. The length is described as SQR( xVal2+ yVal2+ zVal2.

Derived from mel command maya.cmds.emit

Previous topic

pymel.core.effects.dynPref

Next topic

pymel.core.effects.emitter

Core

Core Modules

Other Modules

This Page