Copy link to clipboard
Copied
Any tips on getting a child to cancel out the scaling of its parent? The parent in this case scales X and Y differently, And I can't figure out how to anti-scale the child so it doesn't stretch.
On the child, I'm trying to do an inverse proportion. (But this obviously applies it to both X and Y the same). Not sure sure how to call specific X or Y scale.
s = thisComp.layer("Parent").transform.scale;
[(1/s)]
Is giving me a scalar error (?)
Copy link to clipboard
Copied
Try this:
s = parent.transform.scale/100;
[value[0]/s[0],value[1]/s[1]]
Dan
Copy link to clipboard
Copied
As always... brilliant! Thank you very much!
I keep thinking variables can only store one number, not a set of numbers that can be selectively plucked out of a series. Would the programmy term be plucking an element out of a matrix (or is it array?)
If it was a 3D layer, it would be [value[0]/s[0],value[1]/s[1],value[2]/s[2]], right?
Copy link to clipboard
Copied
Yes, arrays, and yes on the 3D version.
Dan
Copy link to clipboard
Copied
Hey Dan!
I trotted this expression out again, but now I'm getting an error in CC 2014. Any ideas? My parent is scaled non-proportionally 100%,75%
Here's what the child has in the scale parameter:
s = parent.transform.scale/100;
[value[0]/s[0],value[1]/s[1]]
Copy link to clipboard
Copied
I just tried it in CC 2014 with the parent at 100,75 and it works fine for me. I'm not sure what the problem could be.
Dan
Copy link to clipboard
Copied
I'm using shape layers for both parent and child. Would that be an issue?
(And thanks for the super quick reply!)
Copy link to clipboard
Copied
Using shape layers doesn't appear to make a difference.
>Also, where is Line 0??
Maybe you've managed to confuse the expression engine.
Dan
Copy link to clipboard
Copied
Aha! I figured it out. I was animating the parent from 0% to 75%. The 0 was causing a div by zero error. I changed it to .001% and the expression works now!
Copy link to clipboard
Copied
Also, where is Line 0??
Find more inspiration, events, and resources on the new Adobe Community
Explore Now