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

Using trim paths to animate in two directions

New Here ,
Jun 23, 2020 Jun 23, 2020

Copy link to clipboard

Copied

I am trying to animate a line using trim paths. I want the line to animate from the centre out i.e. from the centre animating both left and right. Is there anyway to do this?

TOPICS
How to

Views

9.9K

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
LEGEND ,
Jun 23, 2020 Jun 23, 2020

Copy link to clipboard

Copied

Split the path at the center and apply two separate strokes and trim operators. Everything else would be a nightmare, since there's no easy way to calculate the percentages.

 

Mylenium

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 ,
Jun 23, 2020 Jun 23, 2020

Copy link to clipboard

Copied

Trim Paths give you the ability to animate the start and end of a line as well as the offset. The start and end values are percentages so the math is easy. An offset of - 180º makes the start or end animation begin exactly halfway through the line.

 

By far the easiest way to have a line form from both ends and meet in the exact middle or grow from the middle is to animate the End from zero to 100% and the offset from 0º to -180º to make a line start at the end or animate the Start from 100% to 0% and the Offset from 0º to -180º. 

Meet in the middle.gif

The other way would be to animate the Start from 50% to 0% and the End from 50% to 100%. Either one of these techniques will do what you ask and you can offset the meeting point or starting point by simply adjusting the percentages.

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
New Here ,
Jan 09, 2021 Jan 09, 2021

Copy link to clipboard

Copied

this is very helpful, appreciate the time taken to walk through this

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 ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

1) add trim path to the line
2) dublicate the line
3) set 1st line trim keyframes Start 50%->0%
4) set 2st line trim keyframes  End 50%->100%
voilàa

___
Lottie and Rive animation for your web or mobile project.

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
New Here ,
May 09, 2023 May 09, 2023

Copy link to clipboard

Copied

LATEST

Make a line.

Add trim paths.

Set two keyframes. 1st at 0%, 2nd at %100.

Duplicate line.

Flip horizontal.

Done.

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