Hi!
I’ve been using Python with Maya in the last year and this week I’ve been getting into Python with Max.
Right now I’m able to add a position constraint to an object but I’m having a hard time figuring out how to “Add Position Target” to it.
import MaxPlus
boneObj = MaxPlus.Factory.CreateGeomObject(MaxPlus.ClassIds.BoneGeometry)
boneObj.ParameterBlock.Height.Value = 10.0
boneObj.ParameterBlock.Width.Value = 10.0
boneNode = MaxPlus.Factory.CreateNode(boneObj)
boneNode.WireColor = MaxPlus.Color(0.67843, 0.72941, 0.79607)
boneNode.Position = MaxPlus.Point3(20, 10, 5)
objCylinder = MaxPlus.Factory.CreateGeomObject(MaxPlus.ClassIds.Cylinder)
nodeCylinder = MaxPlus.Factory.CreateNode(objCylinder)
positionConstraint = MaxPlus.Factory.CreatePositionController(MaxPlus.ClassIds.Position_Constraint)
positionConstraint.SetTarget(boneNode)
nodeCylinder.AssignController(positionConstraint, 2)
That successfully makes a Position Constraint but there’s no position target in it’s list.
I saw this thread on Path Constraints:
It seems like he was able to make a Path Constraint target using a ParameterBlock.
I’m not sure how though.
I tried looking at the parameters available in a Position_Constraint:
for p in nodeCylinder.ParameterBlock.Parameters:
print p.Name, p.Value
which gives me this:
and I see nothing helpful in the INode ParameterBlock.
What am I missing?
Any help would be appreciated.
Also is there any better documentation than this for MaxPlus?
http://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__py_ref_class_max_plus_1_1_i_node_html
It doesn’t seem all that helpful…
If you know of any useful resources for someone just jumping into Python with Max, I’d love to know about them!
Thanks,
Jesse