Currently the ball in my file rotates for the entire duration of my animation. But I would like it to only start rotating at frame 375 and end at frame 700. Is there a code I have to add in the expression section of my driver? If yes can someone please explain to me how it works? Thank you.
If you want the rotation to be driven by scene time, that's just keyframing; no driver required.
But if you want the rotation to be driven by location on the curve-path, then you could construct an expression, perhaps involving
clamp(), relating the curve's
eval_time to the X rotation of the ball.
However, it might be easier and more flexible to leave the
eval_time as it is, and use the f-curve associated with the driver to draw the function relating the driving property on X to the driven property on Y:
With the right set-up (I have to set my driver-editor window to 'Stay On Top'), you can watch the animation while tweaking the f-curve. It's still fiddly, bit a lot less fiddly, IMO, than going backwards and forwards, tweaking values in a long expression.
Edit: (response to commentary)
You've got 2 methods of animating an object along a curve fighting one another. In your version:
Evaluation Timeof your curve is running continuously. The rotation of your ball is driven by that, so it's spinning continuously, too.
- The ball is prevented from moving along the curve according to
Evaluation Timeby being set to 'Fixed Position' and having its
The location of the ball is ignoring
Evaluation Time, the spin of the ball is not.
Either drive both the spin and the location by
Offset, or both the spin and location by
Evaluation Time. Personally I would prefer to drive both by
Offset, forgetting the (legacy?)
Evaluation Time altogether, to make the possibility of animating more than one object down the curve at different speeds cleaner.
But your driver uses
Evaluation Time, so we'll go with that. In the adjusted version below, I've unchecked 'Fixed Position' on the ball, wiped its
Offset key-frames, and, instead, key-framed
Evaluation Time on the curve, imitating your previous locations as closely as I can, so now the location and spin are in sync.