移動先: 概要 戻り値 フラグ. Python 例.

概要

contextInfo( [context name] , [c=boolean], [escapeContext=boolean], [exists=boolean], [image1=boolean], [image2=boolean], [image3=boolean], [title=boolean])

注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。

contextInfo は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。

このコマンドで、指定したコンテキストについての情報を取得できます。

戻り値

string

戻り値の型は照会モードでは照会フラグが基になります。

フラグ

c, escapeContext, exists, image1, image2, image3, title
ロング ネーム(ショート ネーム) 引数型 プロパティ
c(c) boolean create
指定したコンテキストのクラス タイプを返します。
title(t) boolean create
指定したコンテキストのタイトル文字列を返します。
escapeContext(esc) boolean create
カレント ツールを終了できるコマンド文字列を返します。
exists(ex) boolean create
コンテキストが存在する場合は true を、存在しない(または内部的なもので操作できない)場合は false を返します。
image1(i1) boolean create
指定したコンテキストに関連付けられた xpm の名前を返します。
image2(i2) boolean create
指定したコンテキストに関連付けられた xpm の名前を返します。
image3(i3) boolean create
指定したコンテキストに関連付けられた xpm の名前を返します。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : タプルまたはリストとして渡された複数の引数を持てるフラグ

Python 例

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 #