Forgive me for being a tad confused by this reply… Are you linking specifically to your particular comment? This seems to be just a kind of spring expression for position, but not really what I’m looking for
I kinda figured it out and ended up using a variation of Filip Vandueren’s expression for shirts swinging on a moving clothes line which tracked the speed and movement of a parent layer and applied that velocity to rotation, taking into account some dampeners and weight.
I started with a Controller Null with 3 expression controllers on it – one each for inertia, stiffness and mass.
Because the head itself was parented to the neck of the character I couldn’t figure out an easy way to track its velocity at time (I could track the POSITION velocity at a specific time, but couldn’t track the anchorpoint’s velocity at a specific time, which was necessary because I needed the Worldspace coordinates instead of local space as the head was parented to the neck). To solve this, I had another Null (“PonytailPosition”) with its position linked via expression to the worldspace coordinates of the back of the head:
target=thisComp.layer("ponyTail");
target.toWorld(target.anchorPoint);
Then I applied the following to the pony tail’s rotation
inertia = thisComp.layer("CONTROLLER").effect("inertia")("Slider");
stiffness = thisComp.layer("CONTROLLER").effect("Stiffness")("Slider");
mass=thisComp.layer("CONTROLLER").effect("mass")("Slider");
//these are the sliders attached to the Controller null.
//I had to play around with the actual variables quite a bit to get
//the best result, ending up with: .85, .05 and 18 respectively
lagValue = calcValue(0);
f= thisComp.frameDuration;
will=0;
for (t=0; t<=time; t+=f) {
delta = calcValue(t) - lagValue;
will = will * inertia + delta*stiffness ;
lagValue +=will
}
lagValue;
function calcValue(t) {
return -thisComp.layer("N_PonytailPosition").position.velocityAtTime(t)[0]/mass;
}
Again if the parent (the head, in this case) wasn’t not already a child of another layer, I wouldn’t need to link it to another null, I could just pull the position.velocityAtTime right from the head. But because its local position isn’t actually changing, I needed to convert that to world space via another Null. There’s possibly a more efficient way to do this but this worked fine. Thanks once more to Filip Vandueren for the original script