Maya 中的工具设置 python

Tool settings in maya with python

我想知道当我 运行 我的 python 脚本时如何在工具设置中启用一些设置。

我想在我的脚本启动时启用 "Camera Based-Selection".. 我在 maya 的参考页面中找不到任何相关信息。

有人可以帮我吗?

tool settings

您可以使用 selectPref 命令打开和关闭它。要启用它,您需要调用

import maya.cmds as cmds
cmds.selectPref(useDepth=True)

并用

关闭它
cmds.selectPref(useDepth=False)