Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Using multiple Splines as Path Constraint

Anonymous

Using multiple Splines as Path Constraint

Anonymous
Not applicable

3ds Max 2016 on Windows 7

I'm using path constraints to animate an object along a spline. I have an arrow moving along a fuel line to show fuel flow on a diagram. Some fuel lines are in two or three sections, or separate splines. I'd like the arrow object to jump from spline to spline as it moves along a fuel line, but I don't see a way to do so. I've been constraining an arrow per line and timing them along their respective splines so that it looks relatively seamless across multiple sections.

Having the arrow jump from one spline to the next would be much faster and easier to pace. I've tried attaching all splines into one object, but the arrow always loops around one spline. Any thoughts?

-ST

0 Likes
Reply
1,549 Views
7 Replies
Replies (7)

Anonymous
Not applicable

You can have multiple splines for PathConstraint, and you can weight between them.In your case it requires to animate both the weight properties and the path percentage of PathConstraint. So you need a bit experience with the Curve/Trackview for setting the keys/values.

I have made a scene file for you to investigate, but i can only save back to 2017 release.Anyway i will provide the 2017 version, maybe a kind soul can then save it back to 2016 for you.

 

MultipleSpline_PathConstraint.PNG

Path PercentPath Percent

MultipleSpline_PathConstraint_weight.PNG

 

As an alternative that might be easier to setup, i can suggest using multiple splines with each having their own arrow. Then just animate the visibility of the arrows, so it looks like there`s only one.

 

Let me know how it goes!

Kind regards,

Meli

domo.spaji
Advisor
Advisor

Almost missed part where you tried making same path from multiple splines...

You cannot just "attach all splines into one object".

After attaching you have to connect or weld splines end vertices - making same spline shape.

 

Editable Spline (Vertex)

In help file skip the first Connect (checkbox) in Refine group and take look little further  at single simpler Connect (button)

mbb59426
Community Visitor
Community Visitor

This was exactly the right answer.  Confusing for a beginner, but you need to use the tool to connect the end vertices as stated above.

 

0 Likes

leeminardi
Mentor
Mentor

Here's another approach.

 

Let's say that you have 3 splines and three dummy objects. Each dummy has a path constraint to its corresponding spline. If you want a teapot (arrow) to jump from spline to spline at, for example, frames 24 and 66 then

  1. set the %-along value for dummy001 to 100 at frame 24,
  2. set the %-along value for dummy002 to 0 at frame 24
  3. set the %-along value for dummy002 to 100 at frame 66
  4. set the %-along value for dummy003 to 0 at frame 66
  5. set the %-along value for dummy003 to 0 at frame 100 (end frame  of motion)

Assign the following transform script to the teapor (arrow) where dum1 and dum2 are the transform tracks for their respective dummies.

event1 = 24
event2 = 66
case of
(
(F < event1) : dum1
((F >= event1) and (F < event2)) : dum2
(F >= event2) : dum3
)

I'm not crazy about needing to manually change the %-along values and the event frame numbers in the transfomr script but the process is fairly painless.  

leeminardi_0-1696771082208.png

 

 

 

lee.minardi
0 Likes

leeminardi
Mentor
Mentor

Here's an improved version of my last post.  By referencing the percent-along values of the dummies in the script for the teapot editing becomes easier.  To change when to jump between splines (dummies) just edit the frame of the percent-along values for the dummies.  The transform script for the teapot does not have to be edited.  In this example, the variable dum1PA is assigned to the percent along value of dummy001.  Note that the frame you choose for the 100% value of dummy001 will be the frame for the 0% value of dummy002.  Similarly for the dummy 2 to 3 handoff.

case of
(
((dum1PA > 0) and (dum1PA < 100.0)) : dum1
((dum2PA > 0) and (dum2PA < 100.0)) : dum2
(dum3PA > 0) : dum3
default: dum1

)

leeminardi_0-1696774774968.png

 

lee.minardi
0 Likes

mbb59426
Community Visitor
Community Visitor
Yes thank you, Once I understood the process for connecting the splines and
establishing a single path, the animation was quite simple. The downside is
that one has to manually adjust the rotation of the dummy every few frames
so that the roller coaster train appears to ride the tracks. Next problem
for me is to understand the how the rotation of the spline is created and
its values so i can adjust the position of the dummy (as well as any
parallel structure i.e. tracks) to it, if that makes sense.
0 Likes

leeminardi
Mentor
Mentor

@mbb59426 wrote:
... The downside is
that one has to manually adjust the rotation of the dummy every few frames
so that the roller coaster train appears to ride the tracks.
Have you experimented with checking the boxes for Follow and Bank of the Position parameter options for th apth options? 
leeminardi_0-1697132853684.png

 

Next problem
for me is to understand the how the rotation of the spline is created and
its values so i can adjust the position of the dummy (as well as any
parallel structure i.e. tracks) to it, if that makes sense.

If both Follow and Bsnk sre checked I believe that the "rotation", i.e., the orientation of its coordinate system at a poiint on the path of the spline is detemined by the direction to the instantaneous radius of curvature for the spline at that point. 

From 3ds Max documentation:

Follow
Aligns the object to the trajectory as it follows the contour.
Bank
Allows the object to bank (roll) as it negotiates the curves of the spline.

 

You can adjust the twist of roller coaster tracks by editing the twist graph of a lofted shape along a spline.

leeminardi_1-1697133526292.png

Unfortunately, I do not know how to link the resulst to the roll of the object with the path constraint.

lee.minardi
0 Likes