Skip to content

Instantly share code, notes, and snippets.

@animoplex
Last active June 29, 2020 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save animoplex/912145ac481b41d16f283cb9dce4f88b to your computer and use it in GitHub Desktop.
Save animoplex/912145ac481b41d16f283cb9dce4f88b to your computer and use it in GitHub Desktop.
Fixed Dashes Around Circle Stroke - After Effects Expression by Animoplex
// Fixed Dashes Around Circle Stroke - Created by Animoplex: www.animoplex.com
// Apply this to a Ellipse shape layer's Stroke Dash property.
// Full Tutorial: https://www.youtube.com/watch?v=I-Acdl_l9G0&t=562s
src = effect("Slider Control")("Slider");
rad = content("Ellipse").content("Ellipse Path").size[0] / 2;
gap = content("Ellipse").content("Stroke").dash.gap;
seg = src <= 0 ? 1 : src;
2 * Math.PI * rad / seg - gap
// Offset Property Expression
// Apply this to the Stroke's Offset property
content("Ellipse").content("Stroke").dash.dash / 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment