Constraining objects to path

Hi,

Ive been working on an animation where I need to animate multiple instances of an object. I want all the instances to follow a certain path (refer image). So basically if I have the instances randomly distributed, they should start falling into line and then move along the path. Can someone please help me do this asap.

Thanks a lot.

Attachments


Have you tried animating the Influence of the Follow Path constraint for each instance? That seems the most straightforward approach given your description.

Hey could you elaborate a bit please, I dont quite know how to implement that. The thing is I created the instances using Dupliframes and then made the duplicates real objects…Uhm, what next?

Pardon the ignorance, the first time Im trying this.

Don’t mean to put you off, but the best way to start is learning about the Follow Path constraint, and the info about Moving objects on a Path will also help. Otherwise it’s too complex to try and explain from scratch.

In very short terms, you can animate how much the object follows a path (the Path constraint Influence), and can use various settings to determine where the object is along the path at any given frame, which seem to be your main goals.

In terms of the workflow approach, I think I’d aim at getting the objects to march along the path “in step” first, and then start modifying the Path Influence to allow for the random initial positioning. Nice thing about animating complex motions is that you can start at the finish and “walk backward” to the starting line :smiley:

1 Like

Hey, thanks for the links…finally got it…just a small problem…I got the objects to follow the path sequentially using the offset setting in the constraint, but they all end up at the same end point of the curve…Is there a way to make them stop one after the other like beads on a thread? Tried doing it using the Object Ipo simultaneously, but dosent give accurate results…

You can make them stop anywhere on the path by simply animating their location. I a lot of times I work backwards in animation. Start with your end-frame, set it up then build your start frame where the objects begin.

Together, animating the Constraint Influence and Object Location is all you may need to achieve your described scene.

I haven’t done anything exactly like this so it’s only speculative, but maybe try this:

  1. Get all the objects to move where they need to be at their stopping points. One after one, snap the cursor to an object, disable the Follow Path constraint (Influence = 0) temporarily, snap the object to the Cursor (it may have moved off the Path), then set a Location IPO for that object. This insures that the object’s Location IPO is set irrespective of the constraint influence.

  2. For each object, put a single-frame transition from 1 to 0 in the Follow Path constraint IPO so that it “switches off” completely at the point where you want the object to stop. Then the Object IPO that you keyframed in 1) should take over.

Essentially you’re telling the objects where to be at the frame when the constraint turns off, and using their constrained-on-Path Location to establish that point with accuracy.

You may have to edit the Object IPO curves some to make sure that the end-point keyframes don’t jigger the earlier parts of the curves where the objects are only under partial constraint.

Thanks a lot…I guess Im finally getting it…Just 2 more questions…

  1. How do I get the object to follow a different curve after a certain frame? ie, the object should complete its motion along one curve and then begin along a different curve. I tried adding the offset in the second follow path constraint, but it dosent work for some reason.

  2. How do I make the object appear after a certain frame. I dont want them to be visible upto a certain frme after which it should appear just before it begins it motion on the path.

Thanks

  1. Can’t say specifically as it depends on how you have the file set up and what else is happening with the object, but you should have enough info by now to work it out.

  2. http://wiki.blender.org/index.php/Doc:Manual/Animation/Basic/Object_Layer_Animation

Hey I got the first part using the constraint IPO. The new problem is that when I try implementing Chipmasque’s solution:

  1. Get all the objects to move where they need to be at their stopping points. One after one, snap the cursor to an object, disable the Follow Path constraint (Influence = 0) temporarily, snap the object to the Cursor (it may have moved off the Path), then set a Location IPO for that object. This insures that the object’s Location IPO is set irrespective of the constraint influence.
  1. For each object, put a single-frame transition from 1 to 0 in the Follow Path constraint IPO so that it “switches off” completely at the point where you want the object to stop. Then the Object IPO that you keyframed in 1) should take over.

It starts acting weirdly. The second object gets displaced relative to the first object throughout the motion. I’m attaching the blend. Could someone please have a look at it>

Thanks

Attachments

Docomo6.blend (217 KB)

Here is a way to use make an object jump from one path to another.

Attachments

pathJumper.blend (87.9 KB)

OK, I think I’ve fixed a number of probs – look over the attached .blend.

Docomo6-FIX.blend (238 KB)

In it you’ll see the one sphere moving along the path pretty much as you set it up. The other I modified to show how to get it moving on its own and then getting put on the path. Some comments:

  1. Don’t use the same IPO curve for both the sphere objects, because editing one edits the other in that case. This applies to both Object & Constraint IPOs. You can use Add New to create a new IPO and then copy the curves from one to the other as needed.

  2. For the object to follow the Path exactly its Location must be 0,0,0 – anything else is treated as an offset from the path. So you keyframe the independent move up to the point where it joins the path (using the snap trick I mentioned before), then have it immediately got to 0,0,0 on the same frame where the Constraint Influence goes to 1.0. Object IPO is zeroed and the Follow Path then works as expected.

  3. You had two buttons enabled in the Object context:Anim settings panel that were screwing things up: OfsEdit & OfsParent. Not sure what you were using them for, but with them “on” the Constraint was not switching on properly when its IPO went to 1.0 – this was causing a lot of your troubles, I believe. Sure had me flummoxed for a bit.

  4. Unless there’s a particular reason for doing otherwise, use Linear curves (or Bezier and Vector points) for the Speed curves of your Paths, otherwise your objects will pile up on one another instead of following at the offset distance.

Anyway, the attached now does what is seems you want to have done, at least in terms of illustrating how to set it up – you’ll have to finish it off on your own 'cause I got no idea what it is you’re trying to show :smiley:

Where do I send the bill? :wink:

Damn, didnt I attach the ‘free favours’ clause in the text editor of the blend? But seriously, thanks a lot for all the help. Solved a lot of problems I was happily oblivious of.

A slight problem. Maybe I didnt explain clearly what I was attempting in all the hurry, so firstly, Im attaching a paint mock-up i sketched out.

The figure at the bottom keeps spitting out balls in sequence that arrange themselves as shown. Once arranged, the entire string of balls sways as a real string would, like in a slight breze (The paths remain invisible).

2 questions:

  1. I suppose chipmasque’s already provided answers to these somewhere in his previous posts, but Im afraid its not clear to me. Whats happening is that when I try to fix the second bead above the lowermost one (to prevent it from traversing the entire length of the path) using the snapping trick, it displaces even the initial position of the ball so that it now starts displaced from the origin and moves parallel to the paths.

Is it because the location isnt (0,0,0) when I snap it? I have a keyframe in the Object IPO locking the initial position at the origin but it still dosent work…
Do the balls travel the entire length of the path and end up at the same position because the speed curve isnt bezier?

  1. For the swaying of the entire string should i start fixing the location of each ball frame by frame?!? :spin: The thing is just with 2 strings on each side of the bag at the centre, it’s already a monstrous task to do if i try and make individual balls displace laterally on the path. Is there a smarter/practical way to do this…Probably some script that would be in place?

Thanks a lot.

Attachments


  1. Using two paths per object to do what you want isn’t maybe such a good idea, since the jump from one to the other is instantaneous and doesn’t follow the proper trajectory. You can edit the Speed IPO for any path to control how the motion along the path proceeds from frame to frame – a linear slope to the curve is a constant velocity, curving slopes get faster or slower depending on the steepness of the curve at any given point.

  2. As far as I understand your intent, every method you need to do what you describe is illustrated in the fixed .blend I attached above – how to have an object move to a certain point on the path and then follow it (the reverse can be done as well, of course), how to synchronize the Object IPOs (independent motion) with the Constraint IPOs (Path motion), and, when compared to your original file, the difference in motion between Linear (i.e., straight) IPO curves and non-linear (curvy) ones.

Learning curves are beeyotches, no argument, but we all gotta drag ourselves through 'em at one time or another.