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

Expression with delay

Guest
Sep 25, 2012 Sep 25, 2012

Copy link to clipboard

Copied

Hi,

I'm a nooby when it comes to expression, so can anyone please help me with how I can create a certain expression?

I think it's quite simple. I've got 2 layers. One layer has an animation (leader) and the other one needs to follow. Only with a delay of 1 frame. The animations happens on "position", "scale" and "rotation".

Thanks you very much in advance!

Best regards,

John

TOPICS
Expressions

Views

49.7K

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 25, 2012 Sep 25, 2012

Copy link to clipboard

Copied

These should work:

thisComp.layer("leader").transform.position.valueAtTime(time-thisComp.frameDuration)

thisComp.layer("leader").transform.scale.valueAtTime(time-thisComp.frameDuration)

thisComp.layer("leader").transform.rotation.valueAtTime(time-thisComp.frameDuration)

Dan

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
Guest
Sep 25, 2012 Sep 25, 2012

Copy link to clipboard

Copied

Hi Dan!

this really helps! Thank you so much.

Only one more question, because how can I change the number of frames it delays on this expression?

Best regards,

John

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 25, 2012 Sep 25, 2012

Copy link to clipboard

Copied

This should work:

delayFrames = 3;

delay = framesToTime(delayFrames);

thisComp.layer("leader").transform.position.valueAtTime(time-delay)

Dan

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
Guest
Sep 25, 2012 Sep 25, 2012

Copy link to clipboard

Copied

Again this works perfect! Thank you!

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
Participant ,
Oct 01, 2012 Oct 01, 2012

Copy link to clipboard

Copied

These kinds of delays can also be done easily with mamoworld's iExpressions for After Effects.

This requires no code writing at all:

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
Contributor ,
Jul 26, 2016 Jul 26, 2016

Copy link to clipboard

Copied

Dan, it's been 4 years since this originally was posted... but I'm just finding it!

I want to use the "leader" layer to control multiple objects. I have three boxes on screen and one Null (leader).

The Null's Y position is keyframed to move onto the screen from the bottom.

I want box #1 to come on with a delay (as explained above) which works fine.

I want box #2 to come on with a slightly longer delay (easy enough), but I want it to come down from the top of the screen: to mirror the Null's motion.

I know that there's probably 5 year olds out there that can do this for me... but, I'm at the office.

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 ,
Jul 13, 2018 Jul 13, 2018

Copy link to clipboard

Copied

Hey Bryan, I don't know if you'd still care for a solution, as it has been a few years since you inquired.

I just stumbled upon this thread while looking for some answers for a different question of mine, but I recognized your name... Maybe you are a relative of one of my in-laws. I can't quite put my finger on it.

Anyways!

I'll start with my expression for the delay. I went with a "daisy-chain" expression in which the layer references other layers in respect to itself (index).  The leader object contains the motion and no expression controls.

All layers below use this expression:

thisComp.layer(index-1).transform.position.valueAtTime(time-delay);

I used a slider to control my delay. Here's a screenshot of my timeline.

Screen Shot 2018-07-13 at 10.51.03 AM.png

Here's the delay in action.

Now, to answer your question. You would like to keep the motion and delay, but have the object enter from the opposing side of the screen. This can be done by parenting that layer to a Null object. With the null, you can adjust any of the delayed layer's transform elements without effecting the delay expression.

In my example, I had to adjust my anchor point in order to center the layer where I wanted it.

Here is a screen shot of my timeline.

Screen Shot 2018-07-13 at 10.54.25 AM.png

And finally here it is in action.

Like everything After Effects related, I'm sure there are a few different ways to skin this cat.

If you have questions, lemme know!

Hope this helps you out Bryan or really, anybody!

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
Contributor ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

LATEST

Interesting — there are a few Goughs out there, but it's not super common.

Also, it's a famous street name in San Francisco.

Thanks for taking time to work through this—it HAS been a while, so I can't even remember what this was for!?

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