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

Position keyframes based on sliders

Community Beginner ,
Aug 05, 2022 Aug 05, 2022

I'm trying to make a position animation, two keyframes the first and the second positions are beeing taken from two slider controls.

Is that possible?

TOPICS
Expressions , Scripting
171
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
Engaged ,
Aug 05, 2022 Aug 05, 2022

I've run into something like this before; I don't know how to do exactly what you describe, but I have an idea that would achieve the same result. It's a tad complex but maximizes your flexibility:

 

If I know a specific position where I want something to end up, then I'll hard-code that into a set of sliders on a hidden Shape Dynamics layer (I prefer to separate my position properties, it just makes things easier).

 

Then, I'll create a second set of sliders for displacement amounts (so in other words, if I want something to move 250 pixels along an X plane, I'll set the slider for X displacement to 250, and so on).

 

And lastly, I'll create a single slider for the animation percentage. It's literally just a slider that goes from 100 to 0 for the duration of your animation.

 

Now, with all your sliders, this is what you do. You create an expression on your X transform property like so (this isn't exact verbiage so you'll want to parent with your pickwhip to get the syntax right):

temp1 = thisComp.layer("Shape Dynamics").slider("X Position");

temp2 = thisComp.layer("Shape Dynamics").slider("X Displacement");

temp3 = thisComp.layer("Shape Dynamics").slider("Displacement Percentage")/100;

 

temp1 + (temp2 * temp3)

 

And what this does is it tells AfterEffects to add the X displacement amount (times your percentage) to whatever your designated position is. Since your percentage slider is going from 100 to 0, it's decreasing the displacement amount until your object winds up where you wanted it.

 

And all you have to do is the same for your Y coordinate (and Z coordinate if applicable). I like this approach because even though it takes a little more effort to set up at the start, it gives you maximum flexibility if you want to change it later.

 

Hopefully this makes sense but if not let me know.

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 ,
Aug 05, 2022 Aug 05, 2022
LATEST

Thank you for the quick response

This realy helped

Also check this Tutorial

https://www.youtube.com/watch?v=RBi3KEEX04g&ab_channel=ukramedia

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