PDA

View Full Version : Constrain complex motion of null to a curve



inkpen3d
05-18-2009, 12:28 PM
Okay, this is a tricky one and I am not sure if there's an easy solution, but here goes...

In the attached screen shot of an animation that I am working on there is a glass probe that has a complex oscillating up and down motion on the Y-axis. On the left hand side there is a model representing a graph with a (bent) line plotted on it. You'll also see a null sitting within the graph.

The problem that I need to solve is how to get the null to move back and forth along the bent graph line in step with the up/down movement of the glass probe without having to manually key-frame the motion of the null.

The end result of all this should be that at the maximum Y excursion of the glass probe the null is at one end of the graph line and, as the probe descends, the null follows the graph line until, at the minimum Y excursion of the glass probe, the null is at the other end of the graph line. And of course, visa versa as the probe moves in the other direction.

I have investigated using the CurveConstraint motion plugin, but this simply runs the null from one end of the curve to the other over the duration of the animation and there is not an apparent means of coupling the null's motion to the up/down movement of the glass probe.

Other than manually key-framing the motion of the null, does anyone know of a means of achieving the desired end result described above?

Thanks in advance,
Peter

inkpen3d
05-19-2009, 03:30 AM
Right. I think I've found a simple solution that works and I'll describe it here just in case anyone else has a similar type of problem...

I animated the path of the null along the graph line over a range of 0 to 100 frames setting key-frames so that the null followed the curve of the graph line. (Note that the scene as a whole currently has a frame range of 0 to 500 frames - i.e. the null animation is a fraction of the total animation duration.)

I then attached the Cyclist motion plugin to the null and in the setup panel, made the Cycle Frames range the same as the null's animation (i.e. 0 to 100), the Cycle Controller was set as the glass probe on the Y-axis, and the Controller Range set to the values between which I wanted the null to be controlled by the motion of the probe on its Y-axis, and finally, the End Behavior was set to Stop.

I now get the null moving along the graph line in both directions in step with the up/down movement of the glass probe. :)

Hope that helps future head-scratchers!

Peter