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
Full answer: http://stackoverflow.com/questions/3...space-modifier
I understand how the fix works, but why doesn't the original code work?
print MaxPlus.ClassIds.PathDeformSpaceWarp output: Class_ID(0x000110b5, 0x00007f9e)
But the output from your post is different to the ClassID requested by maxscript: $.modifiers[1].ClassID: (MaxPlus.Class_ID(0x000110b4, 0x00007f9e). (Notice the last nr of the first part is different) It could be: 1) ClassIds.PathDeformSpaceWarp is something else inside MaxPlus? Not a modifier? 2) Bug in MaxPlus? 3) Something else?
It must be a bug. See the comment in the first function here. Same type of thing.
http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-Python-API-Documentation/index.html?url=py_ref/demo_class_types_8py-example.html,topicNumber=py_ref_demo_class_types_8py_example_html59dc1b6f-ee19-4624-a8b8-5ed511f9030b