• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how to make an object follow 2 paths.

Explorer ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

(Arial View) So here is what I am trying to do. I make trucking tutorials and i am trying to show a truck and trailer make a right of left-hand turn. Is there a way to make the back of the trailer follow a different path than the front of the trailer?

This animation is a real truck and trailer recorded from a drone and i had to crop taking still images and throwing them into photoshop the get rid of the ground and then throwing them into premiere to playing them in sequence. I really just want to do it in after effects without having to rotate the trailer when it is following a path.

 

 

 

left hard turn.gif

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 21, 2019 Oct 21, 2019

Your YouTube video requires a password. 

 

The trailer is not going to follow the same path as the truck. You have two options. One somewhat automated, the other manual. Depending on the shot manual might be easier. Let's start with Manual:

  1. Select the pen tool and draw a new shape layer with only a thin stroke to describe the path of the truck, set a Path keyframe and cut it.
  2. Add a truck Null to the comp, Press Alt/Option + p to set a position keyframe and paste so the null follows the truck pa
...

Votes

Translate

Translate
Mentor ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

The GIF isn't working.

 

You have one anchor point per object and position is bind to this point. If the object follows a path, it's in relation to this point. There is not way to get a second anchorpoint to the object.

 

But what you try to achieve sounds pretty easy, so if you could give us an image and the desired outcome, I think there are at least 3 solid ways to do it.

 

*Martin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

left hard turn.gif

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

https://youtu.be/8kPwz0_kxZQ

dont know why the gif didnt work

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

truck & trailer.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

Your YouTube video requires a password. 

 

The trailer is not going to follow the same path as the truck. You have two options. One somewhat automated, the other manual. Depending on the shot manual might be easier. Let's start with Manual:

  1. Select the pen tool and draw a new shape layer with only a thin stroke to describe the path of the truck, set a Path keyframe and cut it.
  2. Add a truck Null to the comp, Press Alt/Option + p to set a position keyframe and paste so the null follows the truck path
  3. Select the pen tool and draw a path for the trailer on a different shape layer, set a path keyframe for the path and cut (Ctrl/Comd + x) 
  4. Add. trailer null to the comp, press Alt/Option + p to set a position keyframe and paste so the trailer null now follows the trailer path
  5. Select the Truck null and press Alt/Option + Ctrl/Cmnd + o to open up Transform>Auto Orient and select "orient to path"
  6. Select trailer null and press r to reveal the rotation property and then paste this expression to rotation so the trailer null always looks at the truck null position
    L = thisComp.layer("Truck Null ");
    p1 = fromComp(L.toComp(L.anchorPoint));
    v = p1 - anchorPoint;
    value + radiansToDegrees(Math.atan2(v[1],v[0]))
    ​
  7. Add your Trailer and Truck graphics to the timeline and position the anchor point for the Truck over the fifth wheel or center of the rear wheels and set the anchor point for the Trailer over the center of the back wheels
  8. Hold down the shift key and Parent the Trailer layer to the Trailer null to snap it into the same position as the null
  9. Hold down the shift key and parent the Truck layer to the Truck null to snap it into the same position as the null

Now you are setup. All you have to do is adjust the timing of the motion of the truck and the trailer so they look like they are hooked up. The truck will rotate around the back wheels as a real one would, the trailer will rotate around the back wheels and always be pointed at the hinge pin (fifth-wheel) of the truck. All that is left is to adjust the timing of the keyframes for the truck and trailer so that the trailer maintains the same distance behind the trailer. It should be pretty easy to do when the truck and trailer are moving in a straight line. The corner is probably going to require you to add a few keyframes and even adjust the path so that it looks natural.

 

Your comp will look something like this:

Screenshot_2019-10-21 19.37.55_p9A5O0.png

I have shown you everything you need to see to duplicate this setup. 

 

A more automated way is to set up inverse kinematics between the truck and trailer using expressions. I'm not going to go through all of that at this time. It takes some time to understand and most of the IK solutions out there require a fair amount of understanding of both expressions and the AE UI.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

wow, thank you very much.

I think this link works

https://youtu.be/8kPwz0_kxZQ

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 21, 2019 Oct 21, 2019

Copy link to clipboard

Copied

LATEST

A modified true Inverse Kinematic set of expressions will probably work much better. With the right modifications, you would only need one motion path for the truck. The trailer's distance from the 5th-wheel would remain set and the trailer would always be connected to the tractor (truck) The modifications you would need to make would be to create some kind of virtual rolling friction or some spring tension in the hinge to get the trailer to follow the tractor in a realistic way.

 

I don't have time to work that out for you right now but I suggest that you check out Dan Ebberts Motionscript site or hope he sees your thread. There's plenty of info at Dan's site to get you started if you want to spend a fair amount of time diving into expressions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines