Any ideas anyone? This would be mega useful.
Expressions can return the height and width of a layer. You can write an expression that divides the target layers height and width by the source layer's height and width. There are two ways to write this expression. One using an array, one using individual values.
Here's option 1:
sLayer = [width, height]; // source layer
tLayer = [thisComp.layer("target layer").width, thisComp.layer("target layer").height]; // target layer
[tLayer / sLayer, tLayer / sLayer] * 100
Here's option 2:
tlWidth = thisComp.layer("target layer").width;
tlHeight = thisComp.layer("target layer").height;
slWidth = width;
slHeight = height;
sx = tlWidth / slWidth;
sy = tlHeight / slHeight;
Apply either expression to the source layer's scale property. The outside dimensions of the source and target will now match. If the 'target layer' is the parent the source layer will react normally. If the source layer
is the parent you cannot adjust the scale of the pair without modifying the expression with a value + statement. Here's a sample CS6 project.
This is perfect Rick and exactly what I needed. You are a star Thank you very much.