pymel.core.effects.particleInstancer¶
- particleInstancer(*args, **kwargs)¶
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.
Flags:
Long Name / Short Name Argument Types Properties addObject / a bool This flag indicates that objects specified by the -object flag will be added to the instancer node as instanced objects. aimAxis / aa unicode This flag sets or queries the particle attribute name to be used for the aim axis of the instanced objects. aimDirection / ad unicode This flag sets or queries the particle attribute name to be used for the aim direction of the instanced objects. aimPosition / ap unicode This flag sets or queries the particle attribute name to be used for the aim position of the instanced objects. aimUpAxis / aua unicode This flag sets or queries the particle attribute name to be used for the aim up axis of the instanced objects. aimWorldUp / awu unicode This flag sets or queries the particle attribute name to be used for the aim world up of the instanced objects. attributeMapping / am bool This flag queries the particle attribute mapping list. cycle / c unicode This flag sets or queries the cycle attribute for the instancer node. The options are none, sequential. The default is none. cycleStartObject / sto unicode This flag sets or queries the particle attribute name to be used for the cycle start object of the instanced objects. 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 This flag sets or queries the cycle step unit attribute for the instancer node. The options are framesor seconds. The default is frames. index / i int This flag is used to query the name of the ith instanced object. instanceId / id unicode This flag queries the particle attribute name to be used for the id of the instanced objects. levelOfDetail / lod unicode This flag sets or queries the level of detail of the instanced objects. The options are geometry, boundingBoxor boundingBoxes. The default is geometry. name / n unicode This flag sets or queries the name of the instancer node. 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 This flag sets or queries the particle attribute name to be used for the object index of the instanced objects. particleAge / age unicode This flag sets or queries the particle attribute name to be used for the age of the instanced objects. position / p unicode DEFAULT worldPositionThis 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 This flag indicates that objects specified by the -object flag will be removed from the instancer node as instanced objects. rotation / r unicode This flag sets or queries the particle attribute name to be used for the rotation of the instanced objects. rotationOrder / ro unicode 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. rotationType / rt unicode This flag sets or queries the particle attribute name to be used for the rotation type of the instanced objects. rotationUnits / ru unicode 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 unicode This flag sets or queries the particle attribute name to be used for the scale of the instanced objects. shear / sh unicode This flag sets or queries the particle attribute name to be used for the shear of the instanced objects. visibility / vis unicode This flag sets or queries the particle attribute name to be used for the visibility of the instanced objects. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.particleInstancer
Example:
import pymel.core as pm # 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 )