我正在用python编写maxscript,下面的代码会引发一个类型错误:
import MaxPlus
res = MaxPlus.Core.GetRootNode()
#This is just as example that I use the first child.
child = MaxPlus.INode.GetChild(res,0)
morpherFP = MaxPlus.FPValue()
MaxPlus.Core.EvalMAXScript("Morpher()", morpherFP)
morpher = MaxPlus.FPValue.Get(morpherFP)
MaxPlus.INode.AddModifier(child, morpher)从MaxScript侦听器中,我总是收到以下错误:
在方法'INode_AddModifier‘中键入'exceptions.TypeError’,输入‘Autodesk::Max::修饰符’的参数2“
而morpher的类型是动画(Morpher),动画是修饰符的一个子类。有人能帮我吗?
提前谢谢你
发布于 2015-07-02 09:35:51
我想我找到了一个可能的解决方案(我只知道MaxScript侦听器不会抛出错误):
import MaxPlus
res = MaxPlus.Core.GetRootNode()
#I use the first child as example
child = MaxPlus.INode.GetChild(res,0)
morpher = MaxPlus.Factory.CreateObjectModifier(MaxPlus.ClassIds.Morpher)
MaxPlus.INode.AddModifier(child, morpher)
# the following also seems to work aka it does not throw any errors
child.InsertModifier(morpher,1)如果这是不正确的,或者有一种更容易理解的方法,请告诉我。
https://stackoverflow.com/questions/31180088
复制相似问题