Skip to main content
kathleenb59092085
Participant
July 26, 2017
Answered

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

  • July 26, 2017
  • 2 replies
  • 2815 views

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){

}

}

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:

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

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

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

2 replies

kathleenb59092085
Participant
July 26, 2017

Thanks so much Dan! Your a life saver

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
July 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