Go to: Synopsis. Return value. Keywords.
Flags. Python
examples.
particleInstancer([addObject=boolean], [aimAxis=string], [aimDirection=string], [aimPosition=string], [aimUpAxis=string], [aimWorldUp=string], [attributeMapping=boolean],
[cycle=string], [cycleStartObject=string],
[cycleStep=float], [cycleStepUnits=string], [index=int], [instanceId=string], [levelOfDetail=string], [name=string], [object=string], [objectIndex=string], [particleAge=string], [position=string], [removeObject=boolean], [rotation=string], [rotationOrder=string], [rotationType=string], [rotationUnits=string], [scale=string], [shear=string], [visibility=string])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
particleInstancer is undoable, queryable, and editable.
This command is used to create a particle instancer node and set
the proper attributes in the particle shape and in the instancer
node. It will also create the connections needed between the
particle shape and the instancer node.
In query mode, return type is based on queried flag.
particle, instancer
addObject, aimAxis, aimDirection, aimPosition, aimUpAxis, aimWorldUp, attributeMapping, cycle, cycleStartObject, cycleStep, cycleStepUnits, index, instanceId,
levelOfDetail, name, object, objectIndex, particleAge, position, removeObject, rotation, rotationOrder, rotationType, rotationUnits, scale, shear, visibility
Long name (short name) |
Argument types |
Properties |
name(n) |
string |
  |
|
This flag sets or queries the name of the instancer node. |
|
object(obj) |
string |
    |
|
This flag indicates which objects will be add/removed from the
list of instanced objects. The flag is used in conjuction with the
-addObject and -remove flags. If neither of these flags is
specified on the command line then -addObject is assumed. |
|
addObject(a) |
boolean |
  |
|
This flag indicates that objects specified by the -object flag
will be added to the instancer node as instanced objects. |
|
removeObject(rm) |
boolean |
 |
|
This flag indicates that objects specified by the -object flag
will be removed from the instancer node as instanced objects. |
|
cycle(c) |
string |
   |
|
This flag sets or queries the cycle attribute for the instancer
node. The options are "none", "sequential". The default is
"none". |
|
cycleStep(cs) |
float |
   |
|
This flag sets or queries the cycle step attribute for the
instancer node. This attribute indicates the size of the step in
frames or seconds (see cycleStepUnits). |
|
cycleStepUnits(csu) |
string |
   |
|
This flag sets or queries the cycle step unit attribute for the
instancer node. The options are "frames" or "seconds". The default
is "frames". |
|
index(i) |
int |
 |
|
This flag is used to query the name of the ith instanced
object. |
|
levelOfDetail(lod) |
string |
   |
|
This flag sets or queries the level of detail of the instanced
objects. The options are "geometry", "boundingBox" or
"boundingBoxes". The default is "geometry". |
|
attributeMapping(am) |
boolean |
 |
|
This flag queries the particle attribute mapping list. |
|
aimDirection(ad) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the aim direction of the instanced objects. |
|
aimPosition(ap) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the aim position of the instanced objects. |
|
aimAxis(aa) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the aim axis of the instanced objects. |
|
aimUpAxis(aua) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the aim up axis of the instanced objects. |
|
aimWorldUp(awu) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the aim world up of the instanced objects. |
|
particleAge(age) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the age of the instanced objects. |
|
cycleStartObject(sto) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the cycle start object of the instanced objects. |
|
objectIndex(oi) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the object index of the instanced objects. |
|
position(p) |
string |
   |
|
DEFAULT "worldPosition" This flag sets or queries the particle
attribute name to be used for the positions of the instanced
objects. By default the attribute is worldPosition. |
|
rotation(r) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the rotation of the instanced objects. |
|
rotationType(rt) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the rotation type of the instanced objects. |
|
rotationOrder(ro) |
string |
   |
|
This flag specifies the rotation order associated with the
rotation flag. The options are XYZ, XZY, YXZ, YZX, ZXY, or ZYX. By
default the attribute is XYZ. |
|
rotationUnits(ru) |
string |
   |
|
This flag specifies the rotation units associated with the
rotation flag. The options are degrees or radians. By default the
attribute is degrees. |
|
scale(sc) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the scale of the instanced objects. |
|
shear(sh) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the shear of the instanced objects. |
|
visibility(vis) |
string |
   |
|
This flag sets or queries the particle attribute name to be
used for the visibility of the instanced objects. |
|
instanceId(id) |
string |
 |
|
This flag queries the particle attribute name to be used for
the id of the instanced objects. |
|
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 have multiple arguments, passed
either as a tuple or a list. |
import maya.cmds as cmds
# create a cube and a particle emitter
cmds.polyCube()
cmds.emitter(pos=(0,0,0), type='omni', r=100, sro=0, nuv=0, cye='none', cyi=1, spd=1, srn=0, nsp=1, tsp=0, mxd=0, mnd=0, dx=1, dy=0, dz=0, sp=0)
cmds.particle()
cmds.connectDynamic('particle1',em='emitter1')
# instance the cube to each particle emitted
cmds.particleInstancer( 'particleShape1', addObject=True, object='pCube1', cycle='None', cycleStep=1, cycleStepUnits='Frames', levelOfDetail='Geometry', rotationUnits='Degrees', rotationOrder='XYZ', position='worldPosition', age='age')
# query the instancer associated with the particle
cmds.particleInstancer( 'particle1', q=True, name=True )
# query the particle attribute name corresponding to the position attribute for the instancer
cmds.particleInstancer( 'particle1', name='instancer1', q=True, position=True )