ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Animating shape size based on the value set with the Layer Slider

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dmitry Yershov
Animating shape size based on the value set with the Layer Slider
on Nov 28, 2017 at 7:11:53 pm

Hi,

Is it possible to animate the shape like this, when the shape's length value is defined by the Layer Slider? The idea is, when you change the Slider value, the animation adapts.



(animate it once, not like this gif on repeat :))


Return to posts index

DeMarc Johnson
Re: Animating shape size based on the value set with the Layer Slider
on Nov 29, 2017 at 1:15:29 pm

I can help, but first I would need to know how you animated the circle shape because the method I used to animate the circle shape might be different from the way you do it, and that will determine how to connect the slider control to the animation.

For Expression Tutorials:
https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw


Return to posts index

Dmitry Yershov
Re: Animating shape size based on the value set with the Layer Slider
on Nov 29, 2017 at 3:55:11 pm

So this is not a circle, this is a rounded rectangle with fixed height and the width value is attached to a slider, as well as the X position is the Slider value divided by 2, so it stays in place and expands to the right. What I want to achieve is basically this animation and at the same time I still should be able to control the end width of the rectangle with the same slider. Fixed value for the beginning of the animation and Slider value for the end length. Does that make sense?


Return to posts index


Dmitry Yershov
Re: Animating shape size based on the value set with the Layer Slider
on Nov 29, 2017 at 3:59:50 pm

(btw, subscribed to your channel, thanks!)


Return to posts index

DeMarc Johnson
Re: Animating shape size based on the value set with the Layer Slider
on Nov 29, 2017 at 8:06:14 pm

Thanks for subscribing. I think I might have a solution if I get what you saying. From what I gather from the second post is you want the length to be control by one slider. I was able to do so by using the slider with the size property and the anchor point.

In the anchor point...
transform.anchorPoint - effect("Slider Control")("Slider") / 2

In the size property (inside content property and then inside rectangle path)...
content("Rectangle Path 1").size + effect("Slider Control")("Slider")


For Expression Tutorials:
https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw


Return to posts index

Dmitry Yershov
Re: Animating shape size based on the value set with the Layer Slider
on Nov 29, 2017 at 10:43:24 pm

Here's a quick AE project I've created to hopefully better explain what I had in mind:

11916_example.aep.zip


Return to posts index


DeMarc Johnson
Re: Animating shape size based on the value set with the Layer Slider
on Nov 30, 2017 at 1:12:42 am

Okay, I think I have a full understanding of what you're trying to do. In the Slider Options Animation set the slider to go from 0 to 100. 0 representing the minimum you want the shape to be and 100 being the max length. Don't forget to change the first keyframe to 0 and the second to 100.
Sorry, if I had the older version of AE I would have sent the file back with this post.

In the size property
var animate = thisComp.layer("Slider Options (Animation)").effect("Slider Control")("Slider");
var max = thisComp.layer("Slider Options").effect("Slider Control")("Slider"); //This is the slider that is going set the max range in the linear method.
var minMax = linear(animate, 0, 100, 146, max);
//With this linear method you are animating from the min to max range so if you change max length the animation will do the same
[minMax, 146]

In the position property
var animate = thisComp.layer("Slider Options (Animation)").effect("Slider Control")("Slider") / 2;
var max = thisComp.layer("Slider Options").effect("Slider Control")("Slider");
var minMax = linear(animate, 0, 100, 146, max);
[minMax, 146]


For Expression Tutorials:
https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw


Return to posts index

Dmitry Yershov
Re: Animating shape size based on the value set with the Layer Slider
on Nov 30, 2017 at 1:45:45 am

I happen to have the latese After Effects as well, can you please send your project file after all? Thank you!


Return to posts index

DeMarc Johnson
Re: Animating shape size based on the value set with the Layer Slider
on Nov 30, 2017 at 2:32:22 am

Here is the file...
11919_11916exampleconverted.zip

For Expression Tutorials:
https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw


Return to posts index


Dmitry Yershov
Re: Animating shape size based on the value set with the Layer Slider
on Nov 30, 2017 at 3:11:58 am

Thanks a lot man! This is exactly what I wanted. I wish I was as good with expressions as you are, so I could just solve problems like you did.


Return to posts index

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