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.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

title (t) bool ../../../_images/create.gif
 
Return the title string of the named context.

Derived from mel command maya.cmds.contextInfo

Example:

import pymel.core as pm

import maya.cmds as cmds

# 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' #

Previous topic

pymel.core.general.containerView

Next topic

pymel.core.general.copyAttr

Core

Core Modules

Other Modules

This Page