Copying position value from one layer to another
Hy!
This is Pierluig, from Italy.
I'm a noob in after effect scripting language, but not so new to programming ![]()
Anyway, this is the question:
I have a composition with one layer on it. let's say firstlayer.
The layer has two effects on it: topeffect and bottomeffect.
Bottomeffect is an effect called (Transform).
In my script, I want another layer (let's say secondlayer) to set his position from the position of the bottomeffects of the firstlayer.
Problem is, the property "Position" of the secondeffect of the toplayer is calculated trough an expression.
This expressions use a function, and this function is not recognized by the script language ![]()
I've tried something like:
var myArr = ["0","0"];
myArr = firstlayer.property("Effects").property("(Transform)").property("Position");
secondo.Position.setValue(time,myArr);
And I got the error: Undefined, is not an object.
I've tried lots, tons of variation, and i've got lots, tons of variation in the error message
, but always an error.
So the question is: how can i get my goal?
And my goal is to say, trough a script, after effect to set a property to a layer copying that property from another layer, assuming the layer from wich i copy the property get the property values trough an expression.
Hope I've been clear ![]()
Any help will be reallyappreciated, and I'll remember the helpers in my pray ![]()
Pierlu
