pymel.core.general.contextInfo

contextInfo(*args, **kwargs)

This command allows you to get information on named contexts.

Flags:

Long Name / Short Name Argument Types Properties
apiImage1 / ip1 unicode  
   
c / c bool ../../../_images/create.gif
  Return the class type of the named context.
escapeContext / esc bool ../../../_images/create.gif
  Return the command string that will allow you to exit the current tool.
exists / ex bool ../../../_images/create.gif
  Return true if the context exists, false if it does not exists (or is internal and therefore untouchable)
image1 / i1 bool ../../../_images/create.gif
  Returns the name of an xpm associated with the named context.
image2 / i2 bool ../../../_images/create.gif
  Returns the name of an xpm associated with the named context.
image3 / i3 bool ../../../_images/create.gif
  Returns the name of an xpm associated with the named context.
title / t bool ../../../_images/create.gif
  Return the title string of the named context. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.contextInfo

Example:

import pymel.core as pm

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

# Get the class type of the current context
ctx = pm.currentCtx()
pm.contextInfo(ctx, c=True)
# Result: u'dynParticle' #

# Get the title of the current context
pm.contextInfo(ctx, t=True)
# Result: u'Particle Tool' #