Re: What is the best practice for animation (2024)

I would use a single shape layer with a dashed line and a couple of animators. If you want a continuous loop you only need an animation that is as long as the time it takes to move one dot to the position of another. If you want to reveal the moving dots then you add another shape layer with stroke only and use that as a track matte. You add and animate trim paths. There is no reason to do this kind of thing with 150 layers.

Here are the steps.

  1. Deselect all layers
  2. Press the g key to bring up your pen tool
  3. Set the fill to none and the stroke to the color of your choice. Set the stroke width to the size of your dot - say 20 px
  4. Carefully draw your path starting at the end of the red pipe and moving to the front.
  5. When the path is perfectly drawn then press the U key twice to reveal all modified properties of the shape layer
  6. Spin down the stroke property to reveal line cap, line join and dashes
  7. Press the + nest to dashes twice to add dash gap and offset to the stroke property
  8. Set the dash to zero and the gap to the number of pixels between your dots - 40 would evenly space out 20 pixel dots
  9. Set a keyframe for offset
  10. Move forward one second in the timeline and change the offset value to match your gap setting (40)
  11. Hold down the Alt/Option key and click on Offset to add an expression
  12. Type loopOut() as the expression

You're done. The dots will move from the front of the line to the end of the line and loop until the end point of the layer. You can adjust the speed by moving the second offset keyframe away from the first keyframe to slow down and closer to speed up.

If you want to have the dots start at the beginning and then move to the end of the pipe you can set a keyframe for Path1 and then copy it (Ctrl/Cmnd + c), then deselect the layer and use the pen tool to start a new shape layer above your dotted line. Click the pen anywhere then paste (Ctrl/Cmnd + v). You should now have a solid path above your dotted line. Increase the stroke width by 2 or 3 pixels. Now press the u kay twice again to reveal all modified properties of the layer and notice the little Add button on the right side of the columns in the timeline. Click here and add a trim paths animator. Move to the spot in your timeline where you want to start revealing the dots and set a keyframe for End. Now move down the timeline to where you want the first dot to get to the end of the pipe. Set the value for end to 0.

Now scrub through the timeline and see how the dots are lining up with the end of the line. If they are running into the line then you need to change the speed of the dots or change the timing of the moving line. Using the graph editor and looking at the speed graph will tell you how fast the dots are moving in pixels per second and it will tell you the percentage of the speed of the moving line. This can help you quickly figure out what you need to adjust. When everything lines up you set the solid line as an inverted alpha and you are done.

To tell if your motion is OK you will have to run a full resolution preview because moving dots especially susceptible to stroboscopic effects caused by the interaction of the speed and the frame rate. You should have motion blur turned on. Let me repeat that. You cannot judge the motion of a dotted line unless you run a full resolution full size preview with motion blur turned on. Any other preview is useless. When you run the preview solo the dots layer and step back from your monitor to see if the motion is pleasing. You must do that or you will be posting why is my animation stuttering questions and you will waste a bunch of time.

Here's what the project might look like. This took me about 2 minutes. Notice how close together the offset keyframes are. The offset is precisely 40 pixels. It takes the dots 20 seconds to move from the start of the pipe to the end. The motion works OK for me at full screen but it could use some tweaking.

Re: What is the best practice for animation (1)

Re: What is the best practice for animation (2024)

References

Top Articles
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 5577

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.