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

Bounce Expression error on Path morphing?

Community Beginner ,
Oct 13, 2021 Oct 13, 2021

Hello

 

Would like to know if I'm doint anything wrong, because I'm trying to make my shape bounce when morphed, but I get an error message.

How could I solve this issue? 

 

Thank you!

defaultfxungvr6b20x_0-1634139456387.pngexpand image

 

TOPICS
Expressions
4.2K
Translate
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 , Oct 13, 2021 Oct 13, 2021

This path overshoot expression might be helpful in some situations. It assumes that the number of points doesn't change and it doesn't apply any bounce to the tangents.

freq = 3;
decay = 5;
val = value;
if (numKeys > 0){
  n = nearestKey(time).index;
  if (time < key(n).time) n--;
  if (n > 0){
    path = thisProperty;
    pNow = path.points(time);
    p1 = path.points(key(n).time);
    p0 = path.points(key(n).time - thisComp.frameDuration);
    p = [];
    dur = thisComp.frameDuration;
    t = t
...
Translate
LEGEND ,
Oct 13, 2021 Oct 13, 2021

Compound properties such as shape animation cannot be addressed with this kind of expression. Since all the changes to the path are stored in single keyframes, there simply is no way to access velocity for path anchor points. What you seem to want to do would require creating Null objects as path contzrollers and applying the bounce expression to the Nulls' position.

 

Mylenium

Translate
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 Beginner ,
Oct 14, 2021 Oct 14, 2021

Hello 

 

Thanks for help!

Below I have received an expression that really helped me out obtaining the result that I needed. 

 

Have a nice day

Translate
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 ,
Oct 13, 2021 Oct 13, 2021

For a path to bounce, you need keyframes and the graph editor. The Speed graph will give you control over acceleration and at least 4 keyframes are required. Starting Position, Maximum deformation, Resting position created just before Maximum Distortion, then a copy of Resting Position pasted after the Maximum Deformation keyframe. Fiddle with the handles. If you need more than one bounce then you need to set interim keyframes.

RickGerard_0-1634152462904.gifexpand image

Translate
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 ,
Oct 13, 2021 Oct 13, 2021

This path overshoot expression might be helpful in some situations. It assumes that the number of points doesn't change and it doesn't apply any bounce to the tangents.

freq = 3;
decay = 5;
val = value;
if (numKeys > 0){
  n = nearestKey(time).index;
  if (time < key(n).time) n--;
  if (n > 0){
    path = thisProperty;
    pNow = path.points(time);
    p1 = path.points(key(n).time);
    p0 = path.points(key(n).time - thisComp.frameDuration);
    p = [];
    dur = thisComp.frameDuration;
    t = time - key(n).time;
    for (i = 0; i < p1.length; i++){
      amp = (p1[i] - p0[i])/dur;
      w = freq*Math.PI*2;
      p.push(pNow[i] + amp*(Math.sin((t)*w)/Math.exp(decay*(t))/w));
    }
    val = createPath(p, path.inTangents(), path.outTangents(), path.isClosed())
  }
}
val
Translate
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 Beginner ,
Oct 14, 2021 Oct 14, 2021

Great help! Thanks very much

Translate
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 ,
Oct 14, 2021 Oct 14, 2021
LATEST

Dan, brilliant. If anybody could do it it would be you.

Translate
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