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

Continuously looping a dashed stroke with offset

Explorer ,
Aug 30, 2024 Aug 30, 2024

Copy link to clipboard

Copied

Hi,

Wondering if anyone could help me with what seems like a simple problem but I can't seem to get it right. I'm using flowcharts quite a bit, like in the screenshot, and want these dashed lines to seamlessly move to convey a continuous influence of one thing on another. The line animates in with trim paths and then I'm using offset with loopout to keep it moving thereafter. But I can't seem to figure out what the key frames should be. The loops are not going from start to finish but gradually the start point of successive loops seems to edge its way around which gives a staggered look with an increasingly larger initial portion of the stroke not moving. Any pointers would be much appreciated,

Thanks

Frank

TOPICS
Expressions , How to

Views

572

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Aug 30, 2024 Aug 30, 2024

The trick to a seamless loop is setting the Path/Dashes/Offset first frame to zero and then setting the second keyframe to the sum of the Dash and Gap values. If the values are both 20, setting a value of -40 for the second keyframe will work perfectly with a simple loopOut() expression. You can then adjust the speed of the moving dashed line by changing the distance between the first and second keyframes. Negative values for the second keyframe make the dashes move away from the first vertex, a

...

Votes

Translate

Translate
Community Expert ,
Aug 30, 2024 Aug 30, 2024

Copy link to clipboard

Copied

The trick to a seamless loop is setting the Path/Dashes/Offset first frame to zero and then setting the second keyframe to the sum of the Dash and Gap values. If the values are both 20, setting a value of -40 for the second keyframe will work perfectly with a simple loopOut() expression. You can then adjust the speed of the moving dashed line by changing the distance between the first and second keyframes. Negative values for the second keyframe make the dashes move away from the first vertex, and positive values make the dashes move toward the first vertex.

 

You can then set keyframes for TrimPaths/End of zero and 100% and even use the Graph editor to adjust the speed of the growing line.

 

RickGerard_0-1725020443388.gif

 

Votes

Translate

Translate

Report

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
Explorer ,
Aug 30, 2024 Aug 30, 2024

Copy link to clipboard

Copied

Thank you Rick,

That's exactly what I couldn't figure out. I was actually playing with the offset within the trim paths itself which was where I was going wrong. Thanks for the careful explanation! Much appreciated!

 

Votes

Translate

Translate

Report

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
Explorer ,
Sep 02, 2024 Sep 02, 2024

Copy link to clipboard

Copied

Hi again Rick,

Sorry to bother you with a further question. But I was trying to save what I described above as an animation preset. I want to import a stroke from Illustrator and then apply to it an animation preset with the trim paths and the loop out on the offset as you outlined above. It would save me a lot of time to be able just add a preset in this way.

I can't seem to get it to work thought. I've saved the preset and when I apply it to the imported stroke, the trim paths and offset keyframes are in a new group separate to the stroke and i can't seem to find how to match them so that the stroke imported from illustrator animates in this way. Hope that makes sense. 

 

I'm sure I'm doing something simple wrong related to the groups. If you could point me in the right direction I'd really appreciate it!

 

Thanks!

Votes

Translate

Translate

Report

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 ,
Sep 05, 2024 Sep 05, 2024

Copy link to clipboard

Copied

LATEST

It looks like you only have one keyframe in the Offset property with the loopOut() expression.

Votes

Translate

Translate

Report

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