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.")