ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. 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 #
#