-
Creating a shape path that connects two moving shape groups
This is something I could almost certainly throw together with multiple layers and the Beam effect, but I wanted to challenge myself to do it all with one shape layer. I want to animate one of those ball bearing desk toys (the internet tells me they are properly called Newton’s Cradles). If this was a direct side view where each ball has a single straight line connecting it to the top, that would be easy. Just group the ball and the line, make the anchor point where the line connects to the top, and rotate. But my design shows TWO lines coming off each ball and connecting to the top (see image).
So what I have for the two end balls is a shape group for the ball itself, nested inside a group where the anchor point is the midpoint between the end of the two strings. Rotate that and the ball arcs outwards as expected.
Where I’m stuck is the expression that draws the two lines connecting the top of the ball to the top piece. What I’m using is:
pos1 = toComp(thisProperty.propertyGroup(3)("Transform")("Position")); pos2 = content("l ball anchor").content("l ball").transform.position; dots = [pos1+32,pos2]; createPath(dots)pos2 actually does work, but pos1 gives me a point way outside of my composition. (That +32 for pos1 is meant to offset the start of the string from the center of rotation, and it’ll be -32 for the other string.) My understanding of the propertyGroup expression is that this should grab the position of the parent group, but maybe the toComp part isn’t the right way to bring in that data? Thanks guys.
Sorry, there were no replies found.