objExists(
string
)
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
objExists は 「元に戻す」が可能、「照会」が不可能、「編集」が不可能 です。
このコマンドは、指定した名前のオブジェクトが存在するかどうかによって、true または false を返します。| boolean |
import maya.cmds as cmds
# Select an object if and only if it exists.
# Print a warning if it does not exist.
if cmds.objExists('surface1'):
cmds.select('surface1')
else:
print("Warning: no surface exists.")