Go to: Synopsis. Return value. Flags. Python examples.
contextInfo( [context name] , [c=boolean], [escapeContext=boolean], [exists=boolean], [image1=boolean], [image2=boolean], [image3=boolean], [title=boolean])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
contextInfo is undoable, queryable, and editable.
This command allows you to get information on named contexts.
In query mode, return type is based on queried flag.
c, escapeContext, exists, image1,
image2, image3,
title
Long name (short name) |
Argument types |
Properties |
c(c) |
boolean |
 |
|
Return the class type of the named context. |
|
title(t) |
boolean |
 |
|
Return the title string of the named context. |
|
escapeContext(esc) |
boolean |
 |
|
Return the command string that will allow you to exit the
current tool. |
|
exists(ex) |
boolean |
 |
|
Return true if the context exists, false if it does not exists
(or is internal and therefore untouchable) |
|
image1(i1) |
boolean |
 |
|
Returns the name of an xpm associated with the named
context. |
|
image2(i2) |
boolean |
 |
|
Returns the name of an xpm associated with the named
context. |
|
image3(i3) |
boolean |
 |
|
Returns the name of an xpm associated with the named
context. |
|
Flag can appear in Create mode of
command |
Flag can appear in Edit mode of command |
Flag can appear in Query mode of command |
Flag can have multiple arguments, passed
either as a tuple or a list. |
import maya.cmds as cmds
# Create a particle tool context, then switch to it
cmds.dynParticleCtx('dynParticleCtx1')
cmds.setToolTo('dynParticleCtx1')
# Get the class type of the current context
ctx = cmds.currentCtx()
cmds.contextInfo(ctx, c=True)
# Result: dynParticle #
# Get the title of the current context
cmds.contextInfo(ctx, t=True)
# Result: Particle Tool #