Home Technical Talk

MaxPlus Python - 3Ds Max - Add Worldspace Modifier

polycounter lvl 5
Offline / Send Message
vonBerg polycounter lvl 5
Hi!

I'm trying to learn MaxPlus/Python in 3Ds Max, and I'm stuck with creating a worldspace modifier. (Path Deform Binding WSM modifier)

mod = MaxPlus.Factory.CreateWorldSpaceModifier(MaxPlus.ClassIds.PathDeformSpaceWarp)
MaxPlus.ModifierPanel.AddToSelection(mod)
Above code gives the following error:
File "C:\Program Files\Autodesk\3ds Max 2017\MaxPlus.py", line 30534, in CreateWorldSpaceModifier
    return _MaxPlus.Factory_CreateWorldSpaceModifier(*args)
RuntimeError: creation failure
Not sure why it happens, maybe the class ID is wrong? Adding object space modifiers works like a charm.

My current workaround is using the new pymxs:
<pre># pymxs part
rt.execute("meshObj=$")
rt.modpanel.addmodtoselection(rt.SpacePathDeform())
rt.meshObj.modifiers[0].path = rt.s</pre>
But that feels really hacky. Any ideas?

Thanks!

Replies

Sign In or Register to comment.