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

# Constant motion along a single axis

Community Beginner ,
Sep 24, 2022 Sep 24, 2022

Copied

Hello!

Looking for some help with a heart rate monitor effect in After Effects.

I have the heart rate drawn out as a path and have "Trimmed Paths' to animate the path.

I am trying to figure out how I can have the path animate along the x-axis at a constant rate. So while the path will still need to move up and down the y-axis when the heart beats, the movement of the y-axis wont affect the speed that the x-axis is travelling at.

Let me know if I can show you anything that will help explain this better

Many thanks!

TOPICS
Expressions , How to

Views

228

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 Expert , Sep 24, 2022 Sep 24, 2022

Because of the nature of your graph (x is always increasing), you can probably get away with something like this on your Trim Paths End property.

``````resolution = .01;
p = content("Shape 1").content("Path 1").path;
v = p.points();
xStart = v[0][0];
xEnd = v[v.length-1][0];
d = xEnd- xStart;
curX = xStart + d*value/100;
x = 0;
while (p.pointOnPath(x)[0] < curX && x < 1){
x += resolution;
}
x*100``````

7 Replies 7
Community Beginner ,
Sep 24, 2022 Sep 24, 2022

Copied

Here is a clip of the animation I have so far, you can see how the speed along the x-axis slows as it travels up the y-axis to create the heart beat shape. Is there a way to make the path move at a constant rate along the x-axis, so it would shoot up the y-axis quickly to maintain the speed along the x-axis?

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 Expert ,
Sep 24, 2022 Sep 24, 2022

Copied

How about starting with the path completely drawn, and just use Linear Wipe?

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 Beginner ,
Sep 24, 2022 Sep 24, 2022

Copied

Plus I would like to fade the back end of the trail out like you would get on an actual heart rate monitor. That might be tricky with a linear wipe

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 Expert ,
Sep 24, 2022 Sep 24, 2022

Copied

Drawing a mask on a solid layer and use the Vegas Effect. Vegas can do exactly what you need. It has a simple parameter called rotation to "move" the line the way you want. Also you can set the number of segments for the line, in the example is 1. Also has controls for start and end opacity. Even if you apply a simple expresion like time*x (where X is the amount of degrees per second) the effect will auto animate.

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 Beginner ,
Sep 25, 2022 Sep 25, 2022

Copied

LATEST

This was a cool idea and worked well as a heart monitor look, however the movement of the path moved the same way as the standard trim paths animation. Couldn't find a way to make it so that the motion would stay consistant on the x-axis.

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 Expert ,
Sep 24, 2022 Sep 24, 2022

Copied

Because of the nature of your graph (x is always increasing), you can probably get away with something like this on your Trim Paths End property.

``````resolution = .01;
p = content("Shape 1").content("Path 1").path;
v = p.points();
xStart = v[0][0];
xEnd = v[v.length-1][0];
d = xEnd- xStart;
curX = xStart + d*value/100;
x = 0;
while (p.pointOnPath(x)[0] < curX && x < 1){
x += resolution;
}
x*100``````

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 Beginner ,
Sep 25, 2022 Sep 25, 2022

Copied

This worked perfectly! Thanks so much Dan, you're a genius! Only thing I need to change was reduce the resolution to .001 to make the movement a little smoother. Here is what I ended up with...