Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to animation gear

Explorer ,
Jan 01, 2021 Jan 01, 2021

how to make an animation from the attached gear image, is it redrawn one by one is there a quick way.

 

TOPICS
Expressions , How to , Scripting
737
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2021 Jan 01, 2021

Please use this buttons to upload images or videos.

 

Captura de pantalla 2020-12-26 a la(s) 14.43.31.png


Byron.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2021 Jan 01, 2021

If you want to rotate the gears that you see are not meshed, you must use the simple Expression "time". For example time*100 where 100 is the degree of turns per second, if you want it to turn a full turn in 1 second you must put time*360. If you want them to rotate to the left you must write time*-360.


Byron.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2021 Jan 01, 2021

This needs some testing, but I imagine that gears that touch each other should have reversed direction in rotation, that's why I would animate the central one (big red gear) using an expression as Byron said, then I would select all the gears around it and apply a negative expression (e.g: -time*100), then select the next level of gears applying the original expression, and so on. Of course, mathematically this is wrong because speed depends on the radius, but if visually the animation looked correct you can get away with that, otherwise, you should use an expression that depends on the radius

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2021 Jan 02, 2021

If you want to animate the image you uploaded you have to have each gear on a separate layer. You have to count the number of teeth on each gear, figure out the ratio between the number of teeth, then rotate the driven gear in the opposite direction as the drive gear using that ratio. If you make your gears using a shape layer the expression would look like this:

 

 

Drv = thisComp.layer("Drive Gear").content("Polystar 1").content("Polystar Path 1").points;
thisGr = content("Polystar 1").content("Polystar Path 1").points;
ratio = Drv / thisGr;
- thisComp.layer("Drive Gear").transform.rotation * ratio

 

  • The Drv variable is the number of teeth on the gear that is driving the other gear - the Drive Gear layer.
  • The shisGR variable is the number of teeth on the gear on this layer. The anchor points must be in the center of each gear.
  • If the gears do not mesh properly, and only a few of the gears in your image do mesh, then you have to use the diameter and live with gears that don't mesh.

 

 

The comp would look like this:

Screenshot_2021-01-02 00.33.30_EzQyHj.png

Here's a Project File you can look at. 

 

DM me if you are interested in an animation preset that created gears and lets you mesh them together easily. It took about 3 minutes to create this:

ScreenFlow.gif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2021 Jan 02, 2021
LATEST

RIck's expression is the best solution. If you own the extension iExpressions, you don't need to write your own expressions code and can use this iExpression instead:

https://mamoworld.com/after-effects-expression/cog-wheels

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines