0

I made a gear chain and I used #frame/7 to make it rotate continously, and I wanted to know if there is a way to make it start and stop after specific frames and also if there is a way to ease in and out the start and end of the driver.

ViikDraws
  • 1
  • 1
  • The problem you don't realize is that if you disable a driver on a given frame, the evaluated value won't stay on the last value evaluated by the driver. See the comments (For an easy answer) and Stef's answers (For a mathematical approach) here: https://blender.stackexchange.com/q/306627/60486 – Markus von Broady Mar 02 '24 at 11:18

1 Answers1

2

you can use if-statements in drivers. So to make it start and stop you can e.g. do this:

frame/20 if frame > 10 and frame < 50 else 50/20

If the if statement is true, it executes the command before the if, here: "frame/20". The else statement is 50/20, because if the gear stops rotating, it is frame 50 and then it should "stay" in the rotation position.

Note: if you really wanna start and stop your gear multiple times, i would recommend using keyframes.

for easing i am using this formula:

-(Math.cos(Math.PI * x) - 1) / 2

so if you now use this and use it for these values:

frame start: 10 frame end: 50

you can use this as a driver:

50/20 if frame > 50 else 50/20*(cos(pi*((frame-10)/40))-1)/(-2) if frame > 10 else 0

and you will get:

enter image description here

Chris
  • 59,454
  • 6
  • 30
  • 84