A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Conforming motion path to spline while controlling speed of object
Posted: 29 May 2015 06:01 PM   [ Ignore ]  
Total Posts:  138
Joined  2012-04-04

Hi:

Let’s say I have a model of a car that’s moving at 30mph on the Z-axis until frame 60, then speeds up to 45mph, and then at frame 150 speeds up to 60mph.  I can create those acceleration changes fairly easily using velocity curves in the graph editor.

But now I need to make that car move up an onramp and the merge into traffic.  As far as I can tell the best way to create that path is to use a spline, but if use Align to Spline to make the car conform to the path I lose the acceleration keyframes I’ve set up.  I’d have to re-create that movement using Position keyframes in the Align to Spline tag.  I suppose I could use the unaltered animation as a reference.

I’ve tried modifying the path of my keyframed car using the Spline Wrap deformer, but the results are kind of messed up.  I have a camera parented to the car, and it starts doing its own thing when deformed by the Spline Wrap.  Maybe this would work with tweaking.

I also tried to simply adjust the position keyframes of the car to make it go where I want, but I have limited control over the bezier handles.  I can’t extend them.

Any other ways to make a keyframed object move along a spline path?

I’ve attached a rough mockup of my setup showing the cars moving at the rates I want and the path on which I want them to conform.

Thanks.

Shawn

File Attachments
Cars_on_Path.c4d.zip  (File Size: 123KB - Downloads: 358)
Profile
 
 
Posted: 29 May 2015 07:32 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Shawn,

I get the idea, the motion should be the same, but wrapped in a “spline bended container”. There are different “interpretations” of Splines in C4D. I think it is worth to focus for a moment on such.

Just to illustrate the problem, I have attached a file with three “nearly” identical Splines, and four objects running along them, with the same 0-100% progress. Have a look. So, not all options might work to take the movement and translate it to “linear” 0-100%. (Like normalizing the complete movement to 0-1 and translate this to a spline 0-100%, hence the discussion about)

If I got what you like to do correctly, then the animation should be in sync with the original, but the position should change. Sounds like a contradiction, but I get your point.

First of all the spline MUST be of the same length, otherwise the 0-100% (start to finish) movement along in the same time means an change in speed. It is dependent—there is no way of it.

Secondly, the spline, as you can see in the examples, will not work, as it is, as the vertices will change the progress dramatically. A Spline Wrap will bend the car…

How to do it anyway?

I have shown in the file how to get the distance of the spline. How to get the distance of the car you set up? In the Timeline editor you can go to Functions and set your Position track to a Spline, measure it.

The new Spline must have the same length as mentioned.

In the second example I use the Spline Wrap to produce a Polygon as “Object” for the Cloner Object. I made it large, so you can see how the Spline Wrap handles the “Bounding Box”. Make it smaller to avoid such trouble. If it small, it moves from start to finish (0-100%) and not as in the example from a relative 20-120% or something like that.). If the original spline was straight, the movement should now translate to the Spline Wrap Space.

You might use a second spline as Rail.

After all, you might also entertain the idea of a target with a little bit of distance to get a typical car movement.

All the best

File Attachments
CV2_r16_drs_15_ANxx_01.zip  (File Size: 135KB - Downloads: 233)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 29 May 2015 09:13 PM   [ Ignore ]   [ # 2 ]  
Total Posts:  138
Joined  2012-04-04

Hi:

Thanks for the quick reply and taking time to work up these samples.

I have noted that the spline type affects how Align to Spline works.

I’m not sure if these samples get me closer to animating the z position of my car the way I want and then deforming that along a spline and maintaining the velocities I’ve keyframed.

I think the easiest way for me to do this will be to animate the X and Y positions independently of the Z to make the car conform to my onramp and merge and use Align to Path as needed.

Cheers.

Shawn

Profile
 
 
Posted: 29 May 2015 10:09 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Shawn, the points are the key in the example. With that I though you get the movement of you car (you mentioned straight) to 0-100%.

Anyway, lets try it in a different way with a Plane Object as base:

Call up a new Null, leave it on 0,0,0. (Never use the group command with animations!)

Place a Plane object under the path of the car, so it covers precisely the start to end area. This object gives you the exact length. Set up the path via Spline in the same length.

Use a Spline Wrap and check the “Fix Bounding Box” in the moment you see that the dimensions are OK (similar).

With the Spline Wrap> Axis set correctly, the movement should be the same, but in the way the spline is.

You can even count the segments of the Plane object if the positions are the same.

In this way the length-speed-time triangle is the same. (The Plane Object is not needed to be visible.)

The key concept here is to have the animation in a bounding box in the same size as the animation, hence the plane object as supporter of that size. Change in the example the bounding-box from 584.762 to 1,584.762, and see how slow the movement becomes.

All the best

File Attachments
Cv2_r16_drs_15_ANsa_01.c4d.zip  (File Size: 66KB - Downloads: 221)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 29 May 2015 11:16 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: I recorded a one minute clip to show the whole process. I hope it provide what you need.

https://www.amazon.com/clouddrive/share/Ap8n9IfSCcJDsr3UJnzk-K5xvoiuEq80KTIq3ikRqao?ref_=cd_share_link_copy

The file, similar to the one above, used to create the clip.

Tip: If you introduce extreme curves, the animation might look stiff. To remedy this, a simple Delay Effector (set to Spring and for strong effects ~75%+/-) will help automatically. To place the car under Null where the engine sits will improve the plausibility. More precisely is the adjustment of the Cloner Object> Transform>R.B parameter in this case. ;o) As it doesn’t touch the original animation it is easily deleted with out harm.

File Attachments
CV2_r16_drs_15_ANsa_11.c4d.zip  (File Size: 61KB - Downloads: 381)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 22 June 2015 09:13 PM   [ Ignore ]   [ # 5 ]  
Total Posts:  138
Joined  2012-04-04

Sorry I never got a chance to respond and thank you for the assistance.  Many deadlines. 

Cheers.

Shawn

Profile
 
 
Posted: 22 June 2015 09:43 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Shawn,

Thank you very much

All the best

Sassi

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
   
 
 
‹‹ Q&A_miscellaneous      Loft NURBS or better ››