Skip to main content
KieferMcGinn
Participant
September 24, 2022
Answered

Constant motion along a single axis

  • September 24, 2022
  • 1 reply
  • 1989 views

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!

This topic has been closed for replies.
Correct answer Dan Ebberts

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

 

 

1 reply

KieferMcGinn
Participant
September 24, 2022

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?

Dan Ebberts
Community Expert
Community Expert
September 24, 2022

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

KieferMcGinn
Participant
September 24, 2022

I did think about this, but I end up with edges like this...

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