ジャンプ先: 概要. 戻り値. キーワード. 関連項目. フラグ. Python 例.
warning([showLineNumber=boolean])
注意:
オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
warning は 「元に戻す」が不可能、「照会」が不可能、「編集」が不可能 です。
ユーザ独自のスクリプトから警告するメッセージを出せるように、警告コマンドが提供されます。 文字列引数は、言語に適切なセパレータ(Python の場合は #、Mel の場合は //)で囲まれたエラー メッセージを前につけた後、コマンド ウィンドウに表示されます(またはバッチ モードで実行した場合、stdout)。なし
| ロング ネーム(ショート ネーム) | 引数型 | プロパティ | ||
|---|---|---|---|---|
showLineNumber(sl) |
boolean |
|||
|
||||
import maya.cmds as cmds
import maya.cmds as cmds
def lightWarning():
l = cmds.ls( lights=True )
if len(l) == 0:
cmds.warning( "No Lights" )
lightWarning()
#
# The above will produce the following output:
#
# # Warning: No Lights #
#
# When the option to show line numbers in errors is enabled the output will
# be the following:
#
# # Warning: line 4 of 'lightWarning' in '<maya console'>: No Lights #
#