Python 中的 maxscript 函数 "WM3_MC_BuildFromNode"

The maxscript function "WM3_MC_BuildFromNode" in Python

我根据help.autodesk.com中给出的信息使用以下代码在Python中执行maxscript:

import MaxPlus
test = MaxPlus.FPValue()
#The target node has only one morpher and I want to retrieve it using
# .morpher[1]
bool = MaxPlus.Core.EvalMAXScript("WM3_MC_BuildFromNode $node.morpher[1] 1 $target", test)
print bool

如果我打印布尔值,这总是打印:"false"。但是下面的代码有效(又名打印语句 returns true):

import MaxPlus
test = MaxPlus.FPValue()
#The target node has only one morpher
bool = MaxPlus.Core.EvalMAXScript("WM3_MC_BuildFromNode $node.morpher 1 $target", test)
print bool

但是我不能使用后面的代码,因为在我的代码中一个节点必须有多个变形器。 有没有更好的方法使用 Python api for maxscript(我没有找到方法)或者任何人都可以提出如何改进第一个代码的建议。

谢谢

我的问题的解决方案是:

MaxPlus.Core.EvalMAXScript(WM3_MC_BuildFromNode(for mod in $node.modifiers where isKindOf mod Morpher collect mod)[1] 3 $target)

此解决方案由 Swordslayer 在 3ds Max 的 autodesk 论坛上找到