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.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
addObject (a) | bool | ||
|
|||
aimAxis (aa) | unicode | ||
|
|||
aimDirection (ad) | unicode | ||
|
|||
aimPosition (ap) | unicode | ||
|
|||
aimUpAxis (aua) | unicode | ||
|
|||
aimWorldUp (awu) | unicode | ||
|
|||
attributeMapping (am) | bool | ||
|
|||
cycle (c) | unicode | ||
|
|||
cycleStartObject (sto) | unicode | ||
|
|||
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) | unicode | ||
|
|||
index (i) | int | ||
|
|||
instanceId (id) | unicode | ||
This flag queries the particle attribute name to be used for the id of the instanced objects.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
levelOfDetail (lod) | unicode | ||
|
|||
name (n) | unicode | ||
|
|||
object (obj) | unicode | ||
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. |
|||
objectIndex (oi) | unicode | ||
|
|||
particleAge (age) | unicode | ||
|
|||
position (p) | unicode | ||
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. |
|||
removeObject (rm) | bool | ||
|
|||
rotation (r) | unicode | ||
|
|||
rotationOrder (ro) | unicode | ||
|
|||
rotationType (rt) | unicode | ||
|
|||
rotationUnits (ru) | unicode | ||
|
|||
scale (sc) | unicode | ||
|
|||
shear (sh) | unicode | ||
|
|||
visibility (vis) | unicode | ||
|
Derived from mel command maya.cmds.particleInstancer
Example:
import pymel.core as pm
import maya.cmds as cmds
# create a cube and a particle emitter
pm.polyCube()
# Result: [nt.Transform(u'pCube1'), nt.PolyCube(u'polyCube1')] #
pm.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)
# Result: nt.PointEmitter(u'emitter1') #
pm.particle()
# Result: [nt.Transform(u'particle1'), nt.Particle(u'particleShape1')] #
pm.connectDynamic('particle1',em='emitter1')
# Result: [u'particleShape1'] #
# instance the cube to each particle emitted
pm.particleInstancer( 'particleShape1', addObject=True, object='pCube1', cycle='None', cycleStep=1, cycleStepUnits='Frames', levelOfDetail='Geometry', rotationUnits='Degrees', rotationOrder='XYZ', position='worldPosition', age='age')
# Result: u'instancer1' #
# query the instancer associated with the particle
pm.particleInstancer( 'particle1', q=True, name=True )
# Result: [u'instancer1'] #
# query the particle attribute name corresponding to the position attribute for the instancer
pm.particleInstancer( 'particle1', name='instancer1', q=True, position=True )