FORUMS: list search recent posts

Retain relative position values while pick whipping two objects within a layer to other layers

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tom Pilla
Retain relative position values while pick whipping two objects within a layer to other layers
on Jan 30, 2019 at 6:18:37 pm

Hi,

I'm sure this is a simple thing, but I can't figure it out.

I'm trying to "parent" two objects (polygons) within a shape layer, each to a separate other shape layer (lines), for a simple horizontal movement. When the line moves, I want the polygon to move with it. Simple.

Because I'm using the polygons as mattes on a background image, I have to keep them in the same layer. So I can't parent them. I'm pick whipping the position expression of each polygon to its designated line's position. However, as soon as I pick whip, the polygons snap out of position -- their position values become the same absolute values as the line; I need them to be relative.

Thanks for the help!

-Tom


Return to posts index

Dave LaRonde
Re: Retain relative position values while pick whipping two objects within a layer to other layers
on Jan 30, 2019 at 9:40:26 pm
Last Edited By Dave LaRonde on Jan 31, 2019 at 3:47:23 am

Why do it the hard way? Just animate the layers' horizontal positions.
Y'know, using them old-school, yet highly effective keyframes!

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Tom Pilla
Re: Retain relative position values while pick whipping two objects within a layer to other layers
on Jan 31, 2019 at 4:42:00 pm

Thanks very much Dave. That was my backup plan, which I ended up using.

Would be nice to know if there's a way around this for the future, though ... I can imagine more complex situations where going old school might not be feasible, with more objects in the matte layer, strange shapes on crazy paths, etc. (e.g. keyframing this was a little bit of a pain with getting the speed ramps just right, and it was a very simple movement.)

Anyone know?


Return to posts index


Oleg Pirogov
Re: Retain relative position values while pick whipping two objects within a layer to other layers
on Feb 2, 2019 at 9:45:41 am

When you pick whip one position to another you get something like in expression window:

thisComp.layer("Shape Layer 1").content("Ellipse 1").transform.position;

What you probably need is:

pos = thisComp.layer("Shape Layer 1").content("Ellipse 1").transform.position;
value + pos - pos.valueAtTime(CERTAIN_TIME_POINT);


This captures relative change in parent-shape's position and adds it to the child-shape's position. That change is relative to a CERTAIN_TIME_POINT (in seconds) which you need to pick up. In the end it works like usual layer parenting.


Return to posts index

Harry Hoag
Re: Retain relative position values while pick whipping two objects within a layer to other layers
on Feb 3, 2019 at 4:04:00 pm

Hey man,

Oleg's answer is definitely the way to go, it's the most versatile way, if you make his (CERTAIN_TIME_POINT) just 0 it should work, so that effectively zeros out the animation transformations. Then you're just adding values to it's current value rather than adding two unknown values together.

It's good to keep shape layer positions clean for this type of thing. So when you make a new shape, make sure all the positions are 0,0 and all the scales are 100,100, particularly the group position as that tends to default to something non zero when you use the shape tool. Starting at 0,0 and 100,100 is always much less of a headache than some random numbers that you have to cancel out later.


Return to posts index

Tom Pilla
Re: Retain relative position values while pick whipping two objects within a layer to other layers
on Feb 4, 2019 at 4:17:40 pm

Yes! That is exactly what I was looking for. Thanks guys, that's perfect. Much appreciated.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]