Proximity Expression in After Effects
Vložit
- čas přidán 23. 11. 2021
- ▼ After Effects Beginners Course ▼
www.domestika.org/en/courses/...
Learn how to create this proximity expression in After Effects. In this easy After Effects tutorial, you will learn how to adjust the scale of shapes using expressions.
▼ Proximity Expression▼
target = thisComp.layer("Target");
dist = Math.floor( length(position, target.position) );
maxSize = thisComp.layer("Target").effect("maxSize")("Slider");
minSize = thisComp.layer("Target").effect("minSize")("Slider");
range = thisComp.layer("Target").effect("range")("Slider");
sensitivity = thisComp.layer("Target").effect("sensitivity")("Slider");
scle = linear(dist, range, sensitivity, maxSize, minSize);
[scle, scle];
▼ Breton Brander Blog ▼
bretonbrander.wordpress.com/2...
▼ Overlord Plugin ▼
www.battleaxe.co/overlord
-----------------------------------------------
Website: tierney.tv
Instagram: instagram.tierney.tv
Behance: behance.tierney.tv
CZcams: youtube.tierney.tv
Thanks for stopping by :)
Michael Tierney
Motion Designer
www.tierney.tv
#AfterEffects #Expressions #Animation
target = thisComp.layer("Target");
dist = Math.floor( length(position, target.position) );
maxSize = thisComp.layer("Target").effect("maxSize")("Slider");
minSize = thisComp.layer("Target").effect("minSize")("Slider");
range = thisComp.layer("Target").effect("range")("Slider");
sensitivity = thisComp.layer("Target").effect("sensitivity")("Slider");
scle = linear(dist, range, sensitivity, maxSize, minSize);
[scle, scle];
First tutorial on this effect that didn't gave me headaches and worked perfectly smoothly. Great job man.
I´m loving your Domestika course.
Love your work!! Please make more! don't Stop 💯
Such a quick video. Thanks for making it so efficient!
No problemo :)
Amazing tutorial 👏🏻
it would take others an hour to teach this!
thank you very much
i love your tutorials! you are doing great job!
Thanks man, really easy and powerful!
I'm glad you enjoyed it. It sure is :)
Thank you. Your video is the very easy to understand.
Absolute life saver thank you!
Glad to hear it :)
Holy F that's so cool! Didn't know what was going to happen until the end. Thanks for the tip!
This is definitely easier then how I've done this before. Cool vid
Thanls! and SNAP! :) I tried a few different ways and reduced it down to the least clicks possible. Glad you like it :)
this is awesome, thanks!
Glad to hear it :)
Just discovered your channel, loving your tutorials. I recognise that accent anywhere btw 😁👍🏻
Great tutorial, thank you so much for sharing!!!... Greetings.
No problem at all. Thanks for stopping by :)
Superb tutorial
awesome!
Thanks Ivan :)
So good.
love this
Thanks :)
Hi Michael. Great tutorial, thanx. Comment: How would you make ”reverse” effect?
*Checked to see if I was subscribed. *Looks To See. Already was!!! Great Content.
Люблю пересматривать)
Wow, how cool is this?
Thanks for this video, super handy! Curious if you can use this to drive a fill color, or if something is keyframes with 2 values and have it go from one to another? Thanks!
Hi @Michael , Thanks for this great tut! One doubt is that, what needs to be modified in the expression inorder to make the objects move away from the target ?
Hi @Michael_Tierney thanks for sharing your knowledge! Could you help me? I need to keep the original scale of the objects and then scale when the target will be close to them. Many thanks and congratulations for your work!
Hi Michael, could you please help me?
What should I do if I want to only affect the y scale of an object with the proximity?
Solution: In the last line set a value for the xScale --> [100,scle]
Thank you!
You're welcome! @@orkedits
wow
Hey Michael, is there a way to also effect the opacity of a layer based on proximity?
Which code should I add to the expression in order to do that?
Never mind found a solution, you can just apply the same expression to your opacity (:
@@gregorytzelalidis6007 Hey Gregory, I've had the exact same issue and managed to fix it.
Try using this expression on opacity:
target = thisComp.layer("Target");
dist = Math.floor( length(position, target.position) );
maxSize = thisComp.layer("Target").effect("maxSize")("Slider"); //when the this object is closest, this is how big it can get.
minSize = thisComp.layer("Target").effect("minSize")("Slider"); // how small this object can get.
range = thisComp.layer("Target").effect("range")("Slider"); //how far can the target be before this layer starts to get bigger.
sensitivity = thisComp.layer("Target").effect("sensitivity")("Slider"); // how fast the layer starts to scale up once the target is in range.
scle = linear(dist, range, sensitivity, maxSize, minSize);
[scle];
In general, what seemed to fix the error for me and was the most important part was to:
1. Make sure the naming of everything is correct. (minSize, maxSize, range etc...)
2. Make sure that on the opacity layer there's only [scle]; at the bottom and no y or xscle=100 parameter.
Let me know if that helps, if not I can go back to my files and look again.
The expression doesn't work for me. It seems that AE has a problem with "Slider".
Edit: My AE was in German so the effect "Slider" in my AE has a German name called "Schieberegler" so I just put the german name in and then I searched how to set AE to english. Now I won't have any of those problems anymore.
🙏🙏🙏
Hello, I have a problem. I did the same steps, but it gives me an error. Is it possible to solve it, please?
how would this work if the shapes are parented to a different null?
Found a solution. Just parent the target to that null as well :)
no sirve