Last active
July 1, 2020 07:51
-
-
Save AEnMe/d69c4118af6685026f73303a9dfc3bfd to your computer and use it in GitHub Desktop.
TrimPath-OffsetStroke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Used to offset the dashes of a stroke while the trim start is animated. | |
start = thisProperty.propertyGroup(4).content("Trim Paths 1").start; // Path to the Trim Path's start slider | |
path = thisProperty.propertyGroup(4).content("Path 1").path; // Path to the vector path | |
n = 0; | |
for (i = 0; i < path.points().length - 1; i++) { | |
n += length(path.points()[i], path.points()[i + 1]); // Sum of all the length between two points | |
} | |
offset = start * n / 100; // offset the dashes to stay in place while start is animated | |
value + offset; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment