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

Expression at a specific time

Explorer ,
Jul 02, 2013 Jul 02, 2013

Copy link to clipboard

Copied

Hi,

when I apply an expression it starts from the beginning of the composition, but if I want to start it, for example, after 10 seconds, how can I?

Sorry for my english.

TOPICS
Expressions

Views

11.4K

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 ,
Jul 02, 2013 Jul 02, 2013

Copy link to clipboard

Copied

You can check the current time with the time variable:

if (time >= 10)

{

    // your expression

}

else

{

    // return the actual value you entered manually

    value

}

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 ,
Jul 02, 2013 Jul 02, 2013

Copy link to clipboard

Copied

Thanks for reply but I don't understand very well.

My expression is:

k=130;

a=5;

b=12;

x=k*(1-Math.exp(-a*time)*Math.cos(b*time)); [x,x]

What should I do?

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 ,
Jul 02, 2013 Jul 02, 2013

Copy link to clipboard

Copied

Simply put your expression in place of "// your expression" !

if (time >= 10)

{

    // This will only be executed from 10 s

    k = 130;

    a = 5;

    b = 12;

    x = k*(1-Math.exp(-a*time)*Math.cos(b*time)); [x,x]

}

else

{

    // return the default value

    // in this case the default value is the propertie's value but you can put whatever you want here

    value

}

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 ,
Jul 02, 2013 Jul 02, 2013

Copy link to clipboard

Copied

I'm guessing you're looking for something like this:

timeToStart = 10;

t = time - timeToStart;

if (t > 0){

  k=130;

  a=5;

  b=12;

  x=k*(1-Math.exp(-a*t)*Math.cos(b*t));

  [x,x]

}else

  value;

If you want it to start at the layer's in point, just change the first line to this:

timeToStart = inPoint;

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
Explorer ,
Jul 02, 2013 Jul 02, 2013

Copy link to clipboard

Copied

Thanks Maxwell and Dan!

Now I should make an expression for a bouncing text.

I should like the bottom and width are blocked and the text appear with a bounce of Y axis.

The Y axis go from 0 to 100 and bounce...Can you help me? Do you understand?

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 ,
Jul 05, 2013 Jul 05, 2013

Copy link to clipboard

Copied

There is a problem!

If I use this expression

timeToStart = inPoint;

t = time - timeToStart;

if (t > 0){

  k=324;

  a=5;

  b=12;

  x=k*(1-Math.exp(-a*t)*Math.cos(b*t));

  [x,x]

}else

  value;

at the first frame the scale is at 100% but it must to be at 0%!

Can you help me??

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 ,
Jul 05, 2013 Jul 05, 2013

Copy link to clipboard

Copied

LATEST

I think you just need to change the last line to:

[0,0];

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