我也一直想知道这个命令是什么,但我从未见过其他人使用它,所以最终总是忽略它。
不要因为没有得到它而感到难过,文档很好地解释了示例的工作原理。我不得不四处挖掘才发现它完全忽略了你需要使用cmds.setToolTo()
.
创建 2 条曲线,运行此曲线,然后一次选择一条曲线:
import maya.cmds as cmds
picker = cmds.scriptCtx(
title='Attach Curve', totalSelectionSets=1, fcs="select -r $Selection1; performAttachCrv 0 \"\"",
cumulativeLists=True, expandSelectionList=True, setNoSelectionPrompt='Select two curves close to the attachment points',
setSelectionPrompt='Select a second curve close to the attachment point', setDoneSelectionPrompt='Never used because setAutoComplete is set',
setAutoToggleSelection=True, setSelectionCount=2, setAutoComplete=True, curveParameterPoint=True
)
cmds.setToolTo(picker)
So basically, it's an object picker. When you run it, the cursor changes and it displays instructions for the user. In this example, it says pick 2 curves. When you pick one, the instructions update to say pick another curve. When another curve is picked, a script runs to attach both curves. The user can also hit esc at anytime to cancel it. All the masks parameters are there so that you can limit what type of objects the user can pick.
来自 3dsMax 的这实际上非常棒,但实现感觉很差。对于用户来说,这个选择器正在发生并不明显。这些说明无论如何都没有着色,而且在 Maya 界面的底角很容易被忽略。你也不能从大纲中挑选一个对象,这是一个非常糟糕的设计。据我了解它只支持MEL。
知道这一点很酷,但我仍然认为我不会使用它。