-
1. Re: Simple expression maths question
Adolfo Rozenfeld Dec 2, 2009 1:55 PM (in response to Andy Bay)Fortunately, this is simple.
You need the ability to map a range of values proportionally into another range of values.
The most common range mapping methods in AE expressions are linear() and ease().
So, you would use something like this in Layer 2's opacity.
range = thisComp.layer("Layer 1").transform.opacity;
linear(range, 100, 0, 40, 0);
Obviously, "range" is a variable. It stores the value of layer 1's opacity.
And the linear method works as if it was saying "as range goes from 100 to 0, convert the range proprtionally to 40-0".
I hope it's clear.
-
2. Re: Simple expression maths question
Andy Bay Dec 2, 2009 2:04 PM (in response to Adolfo Rozenfeld)Thank you very much, that certainly works!
I was just thinking that could it be possible to solve this also by multiplying/dividing the values in some manner? Or is it impossible to solve a problem like this with just basic maths?
-
3. Re: Simple expression maths question
David Wigforss-Hv1BNN Dec 2, 2009 2:55 PM (in response to Andy Bay)Of course you can do this by multiplying.
In your example:
L1 = 40 .... 0
L2 = 100 ...0
Layer 2's opacity = (100/40) x Layer1Opacity.
Your problem was you were trying to add, when you needed to multiply....
-
4. Re: Simple expression maths question
Andy Bay Dec 2, 2009 3:20 PM (in response to David Wigforss-Hv1BNN)Thanks! What a simple solution!



