Skip to main content
andrewdraws
Inspiring
November 15, 2023
Question

simple expression question!

  • November 15, 2023
  • 1 reply
  • 261 views

Hi there!  I'm working with someone's AE file, and I need to understand something. 

 

A shape layer has a Group that contains multiple dashed strokes that all move along the line ... and loop. 

 

They're using an expression on the Offset property on each stroke:

 

one stroke will have:

-time * 24 * 6 + 25

 

then the one below will have:

-time * 24 * 6 + 250

 

And the next one will have:

-time * 24 * 6 + 1000

 

Can someone break this down for me?

This topic has been closed for replies.

1 reply

ShiveringCactus
Community Expert
Community Expert
November 16, 2023

Looking at the expressions, my guess is the comp is 24 frames per second.  That explains the 24.  Times 6 is a liitle odd:

  • If time = 1 (1 second) set the value to be 144 + 25
  • If time = 2, set the value to be 288 + 25

The plus (+) values are just offsetting the starting positions, so the second expression offsets the value by 225 from the first.

 

-time is setting the values into the negative, so it's offsetting the strokes by -144 etc...

 

A simpler way to code this would have been to have had the expression on one stroke, (time*-144)+25, then pickwhip this value for the second stroke and add the difference., e.g. "strokeoffset"+225.

The brackets are not "needed", but add clarity.

andrewdraws
Inspiring
November 17, 2023

Thanks for the reply!  ... I think the " x6" was just to speed it up. There's probably a better way to do this.