Page 1 of 1

need script for offset position

Posted: November 15th, 2007, 4:07 am
by mrcmarco
Hi.

I want to change the position of one layer and the position of the other layer should follow them. But if I link the position the second layer jumps to the position of the first layer. I want to keep the position in an offset.

what I want to do:

I set up a character standing in front of a mirror. If he lift his arm the mirrored arm shall move as well. Independent of how far he is standing from the mirror.

Thanx

Posted: November 15th, 2007, 4:34 am
by mrcmarco
so far this works:

thisComp.layer("arm_right").transform.position+temp = thisComp.layer("backview").transform.anchorPoint[0];

Posted: November 15th, 2007, 5:01 am
by Paul Tuersley
I'm actually quite suprised that expression worked. It's ignoring the "temp =" bit which I'd expect to cause an error (temp is undefined), so you're expression is really:

Code: Select all

thisComp.layer("arm_right").transform.position + thisComp.layer("backview").transform.anchorPoint[0];
So at the moment you're just adding arm_right position to backview anchor point. Couldn't you do what you're trying to do with parenting instead?