【问题标题】:MaxPlus Python - 3Ds Max - Add Worldspace ModifierMaxPlus Python - 3Ds Max - 添加世界空间修改器
【发布时间】:2016-12-18 19:23:16
【问题描述】:

我正在尝试在 3Ds Max 中学习 MaxPlus/Python,但我一直坚持创建世界空间修改器。 (路径变形绑定 WSM 修改器)

mod = MaxPlus.Factory.CreateWorldSpaceModifier(MaxPlus.ClassIds.PathDeformSpaceWarp)
MaxPlus.ModifierPanel.AddToSelection(mod)

上面的代码给出了以下错误:

File "C:\Program Files\Autodesk\3ds Max 2017\MaxPlus.py", line 30534, in CreateWorldSpaceModifier return _MaxPlus.Factory_CreateWorldSpaceModifier(*args) RuntimeError: creation failure

不知道为什么会这样,也许是类 ID 错误?添加对象空间修饰符就像一个魅力。

我目前的解决方法是使用新的 pymxs:

# pymxs part
rt.execute("meshObj=$")
rt.modpanel.addmodtoselection(rt.SpacePathDeform())
rt.meshObj.modifiers[0].path = rt.s

但这感觉真的很老套。有什么想法吗?

【问题讨论】:

    标签: python 3dsmax


    【解决方案1】:

    够近了,给你:

    mod = MaxPlus.Factory.CreateWorldSpaceModifier(MaxPlus.Class_ID(0x000110b4, 0x00007f9e))
    MaxPlus.ModifierPanel.AddToSelection(mod)
    

    除了在SDK中查找#define外,还可以通过获取现有对象的classID属性来获取classID,例如$.modifiers[1].classID

    【讨论】:

    • 感谢您的帮助和解释!
    猜你喜欢
    • 2017-02-16
    • 2014-03-29
    • 2014-07-08
    • 2017-09-05
    • 2015-07-11
    • 2019-05-14
    • 2021-04-07
    • 2015-11-18
    • 2017-07-02
    相关资源
    最近更新 更多