need script for offset position

Moderators: Disciple, zlovatt

Post Reply
mrcmarco
Posts: 3
Joined: May 21st, 2007, 1:49 am

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
mrcmarco
Posts: 3
Joined: May 21st, 2007, 1:49 am

so far this works:

thisComp.layer("arm_right").transform.position+temp = thisComp.layer("backview").transform.anchorPoint[0];
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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?
Post Reply