pymel.core.effects.nParticle

nParticle(*args, **kwargs)

The nParticle command creates a new nParticle object from a list of world space points. If an nParticle object is created, the command returns the names of the new particle shape and its associated particle object dependency node. If an object was queried, the results of the query are returned. Per particle attributes can be queried using the particleId or the order of the particle in the particle array. If an object was edited, nothing is returned.

Flags:
Long name (short name) Argument Types Properties
attribute (at) unicode  
   
cache (ch) bool ../../../_images/query.gif ../../../_images/edit.gif
   
conserve (c) float ../../../_images/query.gif ../../../_images/edit.gif
   
count (ct) bool ../../../_images/query.gif ../../../_images/edit.gif
   
deleteCache (dc) bool ../../../_images/query.gif ../../../_images/edit.gif
   
dynamicAttrList (dal) bool ../../../_images/query.gif
   
floatValue (fv) float ../../../_images/query.gif
   
gridSpacing (grs) float ../../../_images/query.gif
   
inherit (i) float ../../../_images/query.gif ../../../_images/edit.gif
   
jitterBasePoint (jbp) float, float, float ../../../_images/query.gif
   
jitterRadius (jr) float ../../../_images/query.gif
   
lowerLeft (ll) float, float, float ../../../_images/query.gif
   
name (n) unicode ../../../_images/query.gif ../../../_images/edit.gif
   
numJitters (nj) int ../../../_images/query.gif
   
order (order) int  
   
particleId (id) int  
   
perParticleDouble (ppd) bool ../../../_images/query.gif
   
perParticleVector (ppv) bool ../../../_images/query.gif
   
position (p) float, float, float ../../../_images/query.gif
   
shapeName (sn) unicode ../../../_images/query.gif ../../../_images/edit.gif
   
upperRight (ur) float, float, float ../../../_images/query.gif
   
vectorValue (vv) float, float, float ../../../_images/query.gif
   

Derived from mel command maya.cmds.nParticle

Example:

import pymel.core as pm

# Creates a particle object with four particles
pm.nParticle( p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9)] )
# Result: [nt.Transform(u'nParticle1'), nt.NParticle(u'nParticleShape1')] #

# Returns the age of the particle with id 2 in object particle1
pm.nParticle( 'particle1', q=True, attribute='age', id=2 )

# Returns the velocity of the 3rd particle in the currently selected
# particle object
pm.nParticle( attribute='velocity', q=True, order=3  )

# Edits the velocity of the 7th particle in the currently selected
# particle object to be 0.0, 1.0, 0.0
pm.nParticle( e=True, attribute='velocity', order=3, vectorValue=(0.0, 1.0, 0.0) )

# Edits the mass of the particle in "particle1" with id 3 to be 0.7
pm.nParticle( 'nParticle1', e=True, attribute='mass', id=3, fv=0.7 )

Previous topic

pymel.core.effects.nBase

Next topic

pymel.core.effects.newton

Core

Core Modules

Other Modules

This Page