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

Error in line 11 AE Inertial Bounce (Created by Dan Ebberts at motionscript.com)

New Here ,
Jul 26, 2017 Jul 26, 2017

Copy link to clipboard

Copied

Hello Adobe comunity. I am struggling with an AE expression that I just don't know what to do! I use AE all the time at work but I am just now getting into using expressions. I picked up this Inertial Bounce online and it is working great on all my images (AI layers) with the exception of one. Ugh. I have tried deleting the layers and re importing, rendering the layer as a .png and applying the expressions, and restarting the program. I'm not sure what is going on here?

My process:

Import AI file as a comp/Document Size

Open comp/ select layer and create keyframes at 0;00;00;00 and 0;00;00;05

go to keyframe at 0;00;00;00 and set Scale to 0% and add easy ease out

hold down alt + left mouse click to open expression and copy and paste this code:

n = 0;

if (numKeys > 0){

n = nearestKey(time).index;

if (key(n).time > time){

n;

}

}

if (n == 0){

t = 0;

}else{

t = time key(

n).time;

}

if (n > 0 && t < 1){

v = velocityAtTime(key(n).time thisComp.

frameDuration/10);

amp = .05;

freq = 4.0;

decay = 8.0;

value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{

value;

}

I immediately get this error:

Screen Shot 2017-07-26 at 10.49.12 AM.pngScreen Shot 2017-07-26 at 11.03.24 AM.png

Screen Shot 2017-07-26 at 11.03.58 AM.pngScreen Shot 2017-07-26 at 11.05.08 AM.png

I would appreciate any help I can get on this issue!

TOPICS
Expressions

Views

2.0K

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

correct answers 1 Correct answer

Community Expert , Jul 26, 2017 Jul 26, 2017

It looks like the expression got mangled somewhere along the line. Try it this way:

n = 0;

if (numKeys > 0){

  n = nearestKey(time).index;

  if (key(n).time > time) n--;

}

if (n == 0){

  t = 0;

}else{

  t = time - key(n).time;

}

if (n > 0 && t < 1){

  v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

  amp = .05;

  freq = 4.0;

  decay = 8.0;

  value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{

  value;

}

Dan

Votes

Translate

Translate
Community Expert ,
Jul 26, 2017 Jul 26, 2017

Copy link to clipboard

Copied

It looks like the expression got mangled somewhere along the line. Try it this way:

n = 0;

if (numKeys > 0){

  n = nearestKey(time).index;

  if (key(n).time > time) n--;

}

if (n == 0){

  t = 0;

}else{

  t = time - key(n).time;

}

if (n > 0 && t < 1){

  v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

  amp = .05;

  freq = 4.0;

  decay = 8.0;

  value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{

  value;

}

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
New Here ,
Jul 26, 2017 Jul 26, 2017

Copy link to clipboard

Copied

LATEST

Thanks so much Dan! Your a life saver

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