pymel.core.effects.particleExists

particleExists(*args, **kwargs)

This command is used to query if a particle or soft object with the given name exists. Either the transform or shape name can be used as well as the name of the soft object.

Derived from mel command maya.cmds.particleExists

Example:

import pymel.core as pm

import maya.cmds as cmds

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

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

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

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

Previous topic

pymel.core.effects.particle

Next topic

pymel.core.effects.particleFill

Core

Core Modules

Other Modules

This Page