Your Ad Here

Go to: Synopsis. Return value. Related. Python examples.

Synopsis

particleExists( <string> )

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

particleExists is undoable, queryable, and editable.

Return value


True if there is a particle object or soft object by the given name, false otherwise. Either the transform or shape name can be used, or the name of a soft object.

Related

particle

Python examples

import maya.cmds as cmds

# If the object does not exist then false (0) is returned
cmds.file( f=True, new=True )
cmds.particleExists( 'particleShape1' )
# Result: 0 #

# Create a particle shape and then querying for
# it will return true (1)
cmds.emitter()
# Result: emitter1 #
cmds.particle()
# Result: particle1 particleShape1 #
cmds.connectDynamic( 'particle1', em='emitter1' )
# Result: particleShape1 #
cmds.particleExists( 'particleShape1' )
# Result: 1 #

# You may also query using the transform name
cmds.particleExists( 'particle1' )
# Result: 1 #

# The name of a soft body object can be used to query as well
cmds.polySphere( r=1, sx=20, sy=20, ax=(0, 1, 0), tx=2, ch=1 )
# Result: pSphere1 polySphere1 #
cmds.soft( c=True )
# Result: pSphere1Particle #
cmds.particleExists( 'pSphere1Particle' )
# Result: 1 #

  

Return to Autodesk Index


Your Ad Here