pymel.core.context.ctxTraverse

ctxTraverse(*args, **kwargs)

This command tells the current context to do a traversal. Some contexts will ignore this command. Individual contexts determine what up/down left/right mean.

Flags:

Long Name / Short Name Argument Types Properties
down / d bool ../../../_images/create.gif
  Move downas defined by the current context.
left / l bool ../../../_images/create.gif
  Move leftas defined by the current context.
right / r bool ../../../_images/create.gif
  Move rightas defined by the current context.
up / up bool ../../../_images/create.gif
  Move upas defined by the current context. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.ctxTraverse

Example:

import pymel.core as pm

# Create a particle context, then switch to it
pm.dynParticleCtx('dynParticleCtx1')
pm.setToolTo('dynParticleCtx1')

# Now you can create particles by mouse clicking
# After creating several particles, we switch to edit mode
pm.ctxEditMode()

# Traverse in the created particles
pm.ctxTraverse(left=True)
pm.ctxTraverse(left=True)
pm.ctxTraverse(right=True)