I’m working on an animation of a bird following a curve.
I’ve created two action strips for my bird : a gliding animation and a “flapping” one.
I would like to animate the influence of my strips according to the way my bird moves on the curve : if the bird ascends, i would like to have my “flapping” animation influence to 1, and 0 on the contrary.
To achieve that, I’ve added a driver to the influence of my strip. On a mathematical point of view, the bird will ascend when the Z value of the derivative vector of the point on the curve where is my bird is positive. But I don’t know how to get that kind of information, nor if there is a better way to achieve this behaviour.
Here’s one hack that might do it. Create a second bird and constrain it to the path just like the first one. Only the second bird is offset behind by a tiny amount. In the driver create two variables, one for the z location of the first bird, z1, and another for the z location of the second bird, z2. Use a scripted expression of z1-z2. There’s your “derivative” Again there’s probably some correct way to do it, but I think that will work.