Hey @Blender_Fun1,
So, where to begin . . . first off, as mentioned by @bandages, drivers are your best solution, but I’ll get to that in a bit
A lot depends on your use for the animation. By far the quickest solution would just be to hand key the two rotations then add a repeating modifier in the graph Editor ( using RepeatWithOffset ) in the animation track for each and you’re done. But that is not the most flexible if you expect to have changes in timings.
You can also ‘fake’ the rotation IF there is no visible distinguishing marks, using the method you have already implemented:
However, this won’t work if there is anything that tracks the rotation - like the peg on the gear in this version -
which appears to snap - because it actually is; the gear resets to it’s original rotation at each ‘loop’
Drivers on the other hand will allow ‘proper’ control, the downside is you’ll also need to use code for this to be flexible, and while it was interesting for me to dust off my Python knowledge, it may be more than you require. But for the sake of completness . . .
And here’s my file. You’ll need to RUN the script BEFORE pressing the Update Dependencies button at the bottom of the drivers tab - see my screen shot. The script will have to be selected from the pull-down menu as it doesn’t load automatically - it’s called GearWheel.
Gears.blend (983.1 KB)
I have no idea how much use this is to you, but I had fun figuring that out
Finally - this is not the only way to code up such a method, it’s possible someone may have a more direct method with the driver window curves.
Some additional points - you’re mapping the gear rotation from -10 to +30 degrees which is 40º but a 12 tooth gear must rotate by 30º ( 360 / 12) per tooth.
Finally - Blender rotations, are displayed as degrees in the viewport but are actually calculated as Radians, which is why I have added two extra functions into the code to convert back and forth. This is not desirable as it introduces rounding errors that will accumulate over enough rotations to de-synchronise the gears.
Anyway, I hope something in that is of help.
Cheers,
Dj