-
expression on layer 1 property — automatically access same property on layer 2?
Hi,
A simplified example– Let’s say I have:
2 layers– one named “leader” and one named “follower”I want an expression that I can apply to any property of the follower layer– and it’ll automatically grab the value of that same property from the leader layer (without me having to edit the expression to enter the specific property name). Kinda copying the animation on the leader layer to the follower layer.
I’ve figured out one way to do it, but I hope there is a cleaner way.
(this only works for X Position and Y Position)
leaderStringVar = "thisComp.layer("leader")";
propertyNameVar = thisProperty.name;if(propertyNameVar == "X Position")
propertyNameVar = "xPosition";
else if(propertyNameVar == "Y Position")
propertyNameVar = "yPosition";eval(leaderStringVar + ".transform." + propertyNameVar + ";");
Any ideas?
Thanks!