What I'm working on is
- to parent the position of "layer B" to the position of "layer A" without losing the position "layer B" has at the moment of parenting....
- to preserve the possibility to modify "layer B" position trough keyframes while it follows that it is linked to
- to unlink "layer B" position from the parent at frame 250 leaving it in the last position it was when the parent has left it
My situation is:
- 25 fps composition
- layer A -a 200px x 200 px square shape with a "wiggle(5,50)" applied to the position and a "time*100" loop rotation
- layer B - same shape as layer A but in a different position. No other animated properties
A the moment my expression for layer B position is this:
Code: Select all
a=thisComp.layer(index-1);
x=value[0];
y=value[1];
stop=250;
stoptime=framesToTime(stop);
ax=a.transform.position[0];
ay=a.transform.position[1];
ax0=a.transform.position.valueAtTime(0)[0];
ay0=a.transform.position.valueAtTime(0)[1];
ax250=a.transform.position.valueAtTime(stoptime)[0];
ay250=a.transform.position.valueAtTime(stoptime)[1];
if (time < stoptime){
[x+ax-ax0, y+ay-ay0]
}else{
[x+ax250-ax0, y+ay250-ay0]
}
I obviously refer to the first 250 frames in which parenting is active. Layer B follows layer A wiggled position, It follows layer A movements through keyframes.. But if I move layer A position in a specific place I want it to start from it does not affect layer B position...
Can someone help me? Thanks