FORUMS: list search recent posts

Animating a rope with ends tied to 2 moving objects

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Karim Daire
Animating a rope with ends tied to 2 moving objects
on Sep 12, 2010 at 6:13:12 pm

Hi,

I am trying to save myself from getting a heart attack from too many keyframes in animating a rope that is adjusting between two moving points.
Since I didn't find any way to tie mask vertices to another object or a null object with a mask and the stroke effect I tried using the beam effect since it was the only one in which I could tie the start- and end-point to another objects position.

I got a complex animation with several Null Objects rigged and now I want to rig another null object to it and tie its position to the endpoint of my beam-effect with an expression.

I run across several problems. First of all the coordinate systems of my objects are all different because of different layer sizes.

Even if I trick around that problem and get my Null moving with the right relative position to my beam endpoint... the beam is not moving.
My Null is moving right but when reading out the Nulls position it is its original position before being affected by the rig and not the one which it is moved to by its parent objects.

I had that problem before when using parented Nulls to drive the emitter point of a particle system. How do you adress the position of a Null that is moved by several parent objects by expressions??

Its hard to get my problem across I think, so here is another try...
my parented Nulls position is 6032/1844.
When I detach the Null from the parent object its position is 9494/3873. Thats the position data I need for my beam expression... but how do I get it from my Null without detaching it from its parent rig??

Thanks in advance for any hints... if anyone has a simpler way of animating that rope relative to a parent rig please let me know too.
I guess this is not the most elegant solution to the problem! :)

Karim


Return to posts index

Michael Szalapski
Re: Animating a rope with ends tied to 2 moving objects
on Sep 13, 2010 at 1:44:54 pm

L=thisComp.layer("Childlayername");
L.toWorld(L.anchorPoint);


- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

mathew fuller
Re: Animating a rope with ends tied to 2 moving objects
on Sep 13, 2010 at 1:56:00 pm

Hope the following helps:

These Expressioss can be used to make a connector that stretches like a rubber band between two layers, which by default are named
“End 1” and “End 2”. Obviously you can change these names to anything you like. The connector layer wants to be a horizontal
rectangle, with the anchor point of the layer moved to the left center edge of the layer.

The connector has 3 separate expressions applied to it: one for position, one for rotation and one for scale. The Expressions are
listed separately below.

// apply this Expression to the Connector layer's Position parameter
// set follow1 below to the name of the first layer to follow
follow1 = "End 1"
this_comp.layer(follow1).position
________________
// apply this Expression to Connector layer's Rotation parameter
// set follow2 below to the name of second layer to follow
follow2 = "End 2"
diff = sub(position,this_comp.layer(follow2).position);
(Math.atan2(diff[1],diff[0]) * 180/Math.PI) + 180
________________
// apply this Expression to Connector layer's Scale parameter
// set follow2 below to the name of second layer to follow
follow2 = "End 2"
stretch = length(position,this_comp.layer(follow2).position);
[stretch,scale[1]];


Return to posts index


Tom Durham
Re: Animating a rope with ends tied to 2 moving objects
on Jan 1, 2011 at 7:02:36 pm

Great stuff! Any thoughts on how to cater this to 3d? Please see this thread if you have a second...

http://forums.creativecow.net/thread/227/17155





================================================
YOU can help save TimeSpace. Join the Chronos Protectorate!

http://www.95ers.com
http://www.SpaceAceMedia.com


Return to posts index

Bill Porter
Re: Animating a rope with ends tied to 2 moving objects
on Apr 23, 2013 at 10:57:23 am

Hi Mathew

Your expressions look like the exact thing I'm looking for. For some reason I'm finding that the scale expression is distorting the connector layer a lot, and stretches it far beyond the "End 2" layer so it doesn't appear connected.

I'm probably missing something. Like if the layers need to be in certain positions or sizes before the expressions are applied?

Do you have an example project I could compare with? Or if you have any pointers I'd be very grateful. I'm inept at figuring it out myself.

Cheers!


Return to posts index

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