
1. Re: Scaling expression help
Rick Gerard Oct 6, 2015 3:35 PM (in response to David Mattingly)You are not getting the array function. Maybe this will help. All properties that have more than one value are arrays. An array is written inside square brackets. For example if you write this as an expression for scale [50, 75] then the layer will be scaled to 50% in X and 75% in Y. If you type .scale[0] in an expression then that will return the X value of scale. .scale[1] is the Y value, and if you have a 3D layer then .scale[2] returns the z scale (this makes a difference in the layer's position when scaling a 3D layer)
Let's look at your expression and set up some variables. I take it that multipleanemountains.jpg 2 is the master layer. Personally I'd rename that layer Master. Let's start by improving your syntax and simplifying the calculations by identifying the property you want to work with as a variable.
m = thisComp.layer("multiplanemountains.jpg 2").transform.scale;
Now you can do your math on variable "m" and it's a lot simpler. This is where I get into some trouble with your request and your math. Let's take your original theory. Divide by 10 then add 100. The correct way to do that would be to write the expression like this:
m/10 + [100, 100];
Here's the result. If the master layer is 100% then the slave layer will be 110%, but if the original layer is 200% then the slave layer will be 120%. I don't think that is what you want. What I think you want is to multiply the master layer by 1.1 so that the slave is 10% bigger than the master. You would write that like this:
m * 1.1
Now when the master is 100% the slave will be 110% and when the master is 200% the slave will be 220%

2. Re: Scaling expression help
David Mattingly Oct 6, 2015 7:49 PM (in response to Rick Gerard)Rick
That did it! Thank you so much for taking the time to write such a complete and thoughtful reply. I struggled all day to figure this out, and your post extended my understanding of expressions.
David Mattingly