Activity › Forums › Adobe After Effects Expressions › Scale Mask to distance between nulls
-
Scale Mask to distance between nulls
Posted by Michael Neumann on December 12, 2013 at 11:35 pmHi,
I am not very skilled when it comes to After effects and I now ran into a small problem:
For now the position of the (Plexus) circle between her hands is calculated with an expression.
I was wondering if there is an expression I can use to let the circle get scaled by the measured distance between the two nulls. Right now everything is keyframed manually and it looks kind of cheesy.
Michael Neumann replied 12 years, 5 months ago 2 Members · 6 Replies -
6 Replies
-
William Marler
December 14, 2013 at 6:52 pmHi Michael, I have worked out how to do it.
Add a slider to the Plexus ball and add this code to it (first expression listed below):
Then, scale up the Plexus ball so its top and bottom points are where you want on the lady’s hands and write down the scale value of this desired size. Also write down the value of the expression slider at this frame.
Now in a calculator app find out the value of (slider value you noted down)/(scale value you noted down) and write that down.
Open the scale property on the Plexus ball and copy and paste this expression into the value (second expression listed below):
Hope this works and if you struggle with my explanation, I can provide a project file for reference.
William
Expression 1
thisComp.layer("name of your bottom null").transform.position[1]-thisComp.layer("name of your top null").transform.position[1]Expression 2
temp = effect("Slider Control")("Slider")/10.8;[temp,temp]
-
Michael Neumann
December 14, 2013 at 10:50 pmHi William,
first of all, thank you very much for the time and effort you put into helping me out!
I did an export of my and your version to show you a problem that I did encounter with your expression.
My Version:
https://reels.creativecow.net/film/cari-final-movement-baseYours:
https://reels.creativecow.net/film/cari-final-movement -
William Marler
December 14, 2013 at 10:56 pmAh yes I see the problem. Based on the reference image you provided, I only assumed the hands would change on the Y axis, which is why the Plexus only scales on that axis and doesn’t at the start. I shall revisit this thread tomorrow morning and have a look at how to incorporate X also.
William
-
Michael Neumann
December 15, 2013 at 9:02 amI guess I found a simple solution:
– Second slider for X
– IF, to find the bigger
– Temp = biggest valuehttps://reels.creativecow.net/film/carifinalmovementsolved
a = effect("Slider Control")("Schieberegler")/3.932;
b = effect("Slider Control 2")("Schieberegler")/3.932;if (a > b){
temp = a;
}else{
temp = b;
}[temp,temp]
-
William Marler
December 15, 2013 at 9:06 amAh nice, apologies for not being able to solve the problem myself, but it’s good that you were able to work it out anyway.
William
-
Michael Neumann
December 15, 2013 at 9:08 amDon’t apologize, I just added on top of your code. I couldn’t have come up with your solution.
Thx!
Reply to this Discussion! Login or Sign Up
