FORUMS: list search recent posts

Scale Mask to distance between nulls

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael Neumann
Scale Mask to distance between nulls
on Dec 12, 2013 at 11:35:32 pm

Hi,

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.



Return to posts index

William Marler
Re: Scale Mask to distance between nulls
on Dec 14, 2013 at 6:52:18 pm

Hi 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]


Return to posts index

Michael Neumann
Re: Scale Mask to distance between nulls
on Dec 14, 2013 at 10:50:48 pm

Hi 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:
http://reels.creativecow.net/film/cari-final-movement-base

Yours:
http://reels.creativecow.net/film/cari-final-movement


Return to posts index


William Marler
Re: Scale Mask to distance between nulls
on Dec 14, 2013 at 10:56:02 pm

Ah 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


Return to posts index

Michael Neumann
Re: Scale Mask to distance between nulls
on Dec 15, 2013 at 9:02:06 am

I guess I found a simple solution:

- Second slider for X
- IF, to find the bigger
- Temp = biggest value

http://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]


Return to posts index

William Marler
Re: Scale Mask to distance between nulls
on Dec 15, 2013 at 9:06:27 am

Ah 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


Return to posts index


Michael Neumann
Re: Scale Mask to distance between nulls
on Dec 15, 2013 at 9:08:40 am

Don't apologize, I just added on top of your code. I couldn't have come up with your solution.
Thx!


Return to posts index

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