[Closed] Possible to make a helper follow a path/spline by Maxscript?
Hello, I’m trying to setup a eyelid rig – it’s working fine however I get some “popping” when i try to translate my ctrl (helper) which is path constrained to a spline. See this thread for more information on this bug:
http://forums.cgsociety.org/showthread.php?p=7368614#post7368614
So I was wondering if there’s any way to constrain a helper/ctrl on a path/spline by using maxscript?
pathInterp and lengthInterp are what you are looking for. That will get you a point along a spline.
Thanks for the reply Paul! What I want to achieve is the same as a path constraint by using a position controller.
I looked up those in the documentation, and managed to get my helper to follow the spline by using the following functions:
[i]pathInterp[/i]<shape> [ <curve_num> ] <parameter>
[i]nearestPathParam[/i]<shape> [ <curve_num> ] <point3> [[i]steps[/i]:<integer> ]
Problem now is that I need to assign the position controller to a dummy, cause I get an error
of self-referencing not allowed If I try to put it on the helper it self.
Here's the code set to a position controller on a dummy:
p3Param = nearestPathParam nSpline 1 nHelper.pos steps:200
nHelper.pos = pathInterp nSpline 1 p3Param
nSpline is assigned to the spline node, and nHelper is assigned to the helper node.
And it seems that this doesn’t give me the “popping” bug when translating the helper found by using the 3dsmax native path constraint. It’s frustrating though that I need to script my own “Path constraint” – things would be alot simpler if only the path constraint in 3ds max would work properly.
(I’m currently using max 2013, but the same problem happens in max 2012)
EDIT the helper will not follow the path in this case, which I understand – so i guess I could link the helpers themself aswell as the path to the head bone. But I can’t help thinking that there might be an more elegant solution to this?
Just have a control object control the percent along path instead of trying to grab the object on the path.
Yeah, that seems to be the best solution – however I guess I still need to use the nearestPathParam in a script controller in order to achieve this? Or is there something similar in max as to Maya’s setRange node?
EDIT Here’s how I currently have set this up, by using a float script on the percent:
nearestPathParam nSpline 1 nCtrl.pos steps: 200
Thanks again for the replies, really helpful!
I think that the path constraint will do it just fine. It is only popping because you are trying to move it along the spine by hand and for some reason that gets to be more of a problem as you get further from the center of world space. It has to do with precision.
Ah yes, that’s what I’m using now Paul.
I’m using stretchy bones for eyelids, and the helpers for each stretchy bone is path constrained to splines following the eyes (toony eyes). I then created a ctrl close to the spline that drives the percentage of the stretchy bone helper (by using the float script I posted above).
Seems to work fine, I was just wondering if there’s any other methods for setting up direct manipulation controls for the percentage of a path constrained helper?