ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Driving a path's shape using a slider control.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Peter Andersen
Driving a path's shape using a slider control.
on Jul 26, 2017 at 6:22:02 am

Hello!

I am attempting to animate a X/Y graph whose shape is dependent upon a variable (it's a correlation coefficient) that I have hooked up to a slider control.
The shape of the graph begins perfectly linear and upward sloping when the correlation is 1.00, but becomes increasingly convex toward the x-axis (or toward the left) as I decrease the slider control variable (the correlation) from 1.00 toward 0.00.

Right now I have been able to achieve this by:
  • Having a solid object whose position moves over a period of 50 frames according to the expression for a fixed value of the slider (correlation = 1.00)

  • Converting the expression to 50 keyframes

  • Pasting the 50 position keyframes as values onto a Shape Layer's path (and adding a stroke)

  • Deleting the 50 position keyframes on the solid, changing my slider control from 1.00 to say 0.75, converting the expression to new 50 new keyframes, then pasting them on another path on my shape layer

  • Rinse repeat for other values of my slider control (say 0.50, 0.20 and finally 0.00)

  • Then creating a final path that I animate/morph from one path shape (based on the original value of 1.00) to the other path shapes of 0.75, 0.50, 0.20, and finally 0.00


  • The obvious problem here is that for each intermediate shape of the curve that I was to display, I have to convert the expression to keyframes and paste it into a new path on my shape layer.

    My question is whether it's possible to have my shape graphed once and linked to my slider control and then have the shape change and become more convex as I animate the slider control from 1.00 toward 0.00.

    I've been able to simulate what I'm after using a write-on effect attached to the position of the solid I was using to generate the keyframes (& toWorld, of course), but can you bend a path on a shape layer directly using an expression linked to a slider?

    Thanks in advance for any help ☺

    - Pete


    Return to posts index

    Dan Ebberts
    Re: Driving a path's shape using a slider control.
    on Jul 26, 2017 at 4:03:41 pm

    I can't completely picture what you're trying to do, but it seems like you could have a shape with two keyframes for the start (straight) and end (curved) configurations over a fixed period, then use valueAtTime() to get the correct tween shape.

    Dan



    Return to posts index

    Peter Andersen
    Re: Driving a path's shape using a slider control.
    on Jul 26, 2017 at 4:36:27 pm

    Thanks for your response, Dan.
    I guess I didn't trust A.E. to give me the correct/precise curve I'm after at any of the intermediate values between the start and the end when using valueAtTime().

    I'll test the tweens now against the precise curves that I've calculated and see how close they are.

    Cheers again!


    Return to posts index


    Peter Andersen
    Re: Driving a path's shape using a slider control.
    on Jul 26, 2017 at 5:31:56 pm

    Here's what I get.

    Red lines are the precise curves that I should get at each pause.
    Green line is the tweened curve (based only off the start and end red lines), paused when it should actually trace the red curve next to it. Not quite accurate enough!


    Return to posts index

    << PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
    © 2017 CreativeCOW.net All Rights Reserved
    [TOP]