PDA

View Full Version : Controlling speed of travel along a spline/path



TheMightySpud
09-10-2018, 11:12 AM
Hi all,

Hopefully someone can help out cause this has been driving me nuts for a few days now.

I have an object travelling along a spline. But what I want to be able to do is have the speed the object is travelling controlled by a null (Note: Speed, not distance).

I was trying to figure out a way to link the Cruise Control motion plugin to a null, but have gotten nowhere. And then I found an old thread on here that uses the Item Motion node from Dponts nodes. Problem is, that particular node doesn't seem to have been updated in the latest LW11 release of the nodes, and the LW9-10 version kills Layout.

Would anyone have a solution that works in 2015.3 ? I did think some kind of expression may work, but I have pretty much no knowledge of expressions. :-/

I hope someone can help.

Thanks
TheMightyspud

lertola2
09-10-2018, 01:23 PM
This might not be exactly what you are looking for but you can use Follower to reference a control null to animate along a spline:

https://forums.newtek.com/attachment.php?attachmentid=142795&d=1536607208

142795
142796

Axis3d
09-10-2018, 03:08 PM
Or just set it up with Spline Control.

https://www.youtube.com/watch?v=kHAtN-gpyh8

TheMightySpud
09-10-2018, 04:26 PM
Yeah I know about those already, but they don't do what I need it to. They control the position, what I want is to control the speed of travel along the spline.

For example. I rotate the null 45 degrees. The object travels along the spline at 45 meters per second. Not 45 meters in distance.

TheMightySpud

jeric_synergy
09-11-2018, 12:22 AM
Worley used to have a plugin called, I think, "Throttle"... it might have just been for rotation.

Interesting problem.

Perhaps HOW the dpkit motion node was setup would give us a starting place to suggest solutions.

ernpchan
09-11-2018, 12:38 AM
You could try Path Animation AI
http://thespread.faulknermano.com/_theoldspread/

TheMightySpud
09-11-2018, 02:38 AM
PathAnimationIA again doesn't really do what I want it to. :(

Worley's Polk had a few 'throttle' type plugins, but they're now very old, and not possible to get anymore. :-/

ODTools does have something that would work, but alas you can only get it as part of the big pack, and tbh, we would haveta buy multiple copies and spending that money and not using any of the other plugins just seems daft to me tbh. :-/

- - - Updated - - -

As for HOW The Dpont example is set up. That's the big problem, I can't find any alternative to the Item Motion node that it relies on. :-/

Qexit
09-11-2018, 06:11 AM
A little more information about exactly what you trying to do would probably help. For example, is the item going to travel at the same speed all along the spline or do you want to vary it ? Does it need to accelerate and decelerate as it travels along or is it just a set speed determined by the null ?

TheMightySpud
09-11-2018, 08:34 AM
It needs to vary throughout the animation. And will accelerate/decelerate (example, frame 0 - heading angle of controller null will be 0, giving the main object a speed of 0..........keyframe at frame 100 with heading angle of controller null = 60, speed of main null 60 m/s etc. So acceleration etc. will be dealt with by the controller null's heading.

jeric_synergy
09-11-2018, 10:23 AM
Is there a node that will output the LENGTH of a motion path?

IOW, you point it at an Item, and it has an output that supplies the length of the motion path (which is a spline, mathematically) from the first keyframe to the last keyframe.

IF you had that piece of information (and I have no expectation that it exists), with the addition of some (hah!) math you could probably create this function.

(btw, that was yet another nice thing about Denis: once I suggested another output on a node and he implemented it in, like, two days. (It was some sort of percentage or total-count.))

TheMightySpud
09-11-2018, 10:35 AM
Well finding out the length of the spline is relatively easy (just move the object to the end of it along the Z Axis as normal and make a note of the number at the end. I can GET the speed of the object travelling along the spline no problem with a little maths, problem comes when trying to accurately SET the speed.

squarewulf
09-12-2018, 02:56 PM
So there is a way to do this, and I actually used a method like this for a ratcheting animation.

User Prince Charming(bryphi77) came up with the idea of using particles and wind. Using the wind to drive a single particle - the wind acts as the accelerator. You animate the wind value then use the particles translation value to drive the vehicle.

Old thread here: https://forums.newtek.com/showthread.php?151518-Ratcheting-animation&highlight=cruise+control

Video: https://www.youtube.com/watch?time_continue=4&v=RRncWuSl8bk

TheMightySpud
09-13-2018, 05:31 AM
Wow, that's kinda genius. But alas, I can't use that exact implementation as it relies on the Motion Info node from dpont, which doesn't work with 2015.3 (it's one that wasn't updated for LW11 :(). But it has given me ideas to try :)

TheMightySpud
09-13-2018, 07:03 AM
Huh, okay, something weird. Was being stupid earlier. Apparently the Item Motion node does work in 2015.3 (as seen in that vid), but mine seems broken, and I've even re-downloaded it, but still doesn't work. Very odd, will poke around though and see if I can get it to work.

squarewulf
09-13-2018, 10:17 AM
You should be able to get away with a good ol' Particle Info node instead.

lertola2
09-13-2018, 01:38 PM
The idea of using wind to push a particle to accumulate a value is very interesting. I have been playing with it and I think the attached setup works. It needs DP Kit particle info so I don't know if we can get something like this to work in Lightwave 2018. In the attached scene the Z direction of a Wind object uses Channel Follower to follow the heading of a control null. A particle emitter emits a single particle which is blown in the Z by the wind. A null uses DP Kit Particle Info node to follow the position of the particle. And the light uses Follower to follow the Z position of the null to animate it along the spline. I also added Cloth FX to the control null so that the calculate button would be available instead of having to select the emitter after each edit to see it. Quite convoluted.

142811
142812

squarewulf
09-13-2018, 03:43 PM
Something like this seems like it would be very easy to script... kind of surprised there is no "speed" plugin already.

jeric_synergy
09-14-2018, 01:16 AM
Well finding out the length of the spline is relatively easy (just move the object to the end of it along the Z Axis as normal and make a note of the number at the end. I can GET the speed of the object travelling along the spline no problem with a little maths, problem comes when trying to accurately SET the speed.
?? Yes, if the spline path is straight, and if it is not a motion path with TCB or any interpolation at its keyframes. @^@

TheMightySpud
09-14-2018, 02:38 AM
@Lertola2 - I had a quick play around with the particle idea (having gotten the Motion Info node working finally), but the problem I had was getting the kind of control I need (same reason I haven't used bullet 'car rig' tools)

@Jeric - Using the built in Spline the path is technically always 'straight' as you only edit the Z axis to make the object travel.

@Squarewolf - I did have the thought of editing the Cruise Control lscript that comes with LW to add in functionality to be able to select a Null and Axis to control the speed, but I'm not a scripter/coder so it's kinda baffling to me. lol.

I am however going to have a look at the Maths involved in Cruise Control and see if I can recreate it using nodes. :)

squarewulf
09-14-2018, 10:20 AM
I am however going to have a look at the Maths involved in Cruise Control and see if I can recreate it using nodes. :)

I don't know much about coding but I don't think that will work, you need to be able to accumulate value over time and the only way I think that is possible is with particles or bullet.

XswampyX
09-14-2018, 03:10 PM
I don't know much about coding but I don't think that will work, you need to be able to accumulate value over time and the only way I think that is possible is with particles or bullet.

Yep. If I drive from Plymouth to London in four hours, then how fast was I travelling through Exeter, in rush hour?

No amount of maths is going to give you the correct result, given the limited information.

Ztreem
09-14-2018, 03:22 PM
Hi all,

Hopefully someone can help out cause this has been driving me nuts for a few days now.

I have an object travelling along a spline. But what I want to be able to do is have the speed the object is travelling controlled by a null (Note: Speed, not distance).

I was trying to figure out a way to link the Cruise Control motion plugin to a null, but have gotten nowhere. And then I found an old thread on here that uses the Item Motion node from Dponts nodes. Problem is, that particular node doesn't seem to have been updated in the latest LW11 release of the nodes, and the LW9-10 version kills Layout.

Would anyone have a solution that works in 2015.3 ? I did think some kind of expression may work, but I have pretty much no knowledge of expressions. :-/

I hope someone can help.

Thanks
TheMightyspud

You say speed not disstance? you know that speed is defined by distance over time, don't you?

As you do this in Lightwave I assume that it's going to end up as an animation and not a realtime app, so why do you need to control the speed with a null? it is possible but sometimes its just as easy to work straight in the graph editor.

Here's an example with spline control. I hope it can help or give ideas.
142815

XswampyX
09-15-2018, 06:45 AM
You say speed not disstance? you know that speed is defined by distance over time, don't you?

As you do this in Lightwave I assume that it's going to end up as an animation and not a realtime app, so why do you need to control the speed with a null? it is possible but sometimes its just as easy to work straight in the graph editor.

Here's an example with spline control. I hope it can help or give ideas.
142815

I think we might have a winner! :dance:

jeric_synergy
09-15-2018, 02:24 PM
It's possible the OP was anticipating many revisions and just wanted an easy control to vary the speed, versus setting keyframes.

Qexit
09-15-2018, 03:26 PM
It's a pity Worley's plugins are no longer available as there is one in the Polk collection called VelAccel that would probably meet the OPs needs. It was part of the Henry Clay Collection that came as a bonus. The full description was:

VelAccel

Allows you to keyframe object velocities instead of positions. This makes smooth parabolic arcs easy (negative Y accel, constant X and Z velocity.) It can also be useful to make smooth accelerations of cars, since keyframing a smooth acceleration is hard.

142821

I never had a use for it myself but just loaded it up in LW2018.0.6 after dusting off my old USB dongle so it would at least try to work.

Ztreem
09-15-2018, 03:45 PM
It's possible the OP was anticipating many revisions and just wanted an easy control to vary the speed, versus setting keyframes.

Yes, but if you use a null for doing so you only transfer the keyframes to that null instead of your object. You donít really gain anything, sometimes its easy to overthink and complicate things instead of just do it.
I donít say there isnít a reason or that you should not do it but you should think it through before you do it.

Ztreem
09-15-2018, 03:49 PM
It can also be useful to make smooth accelerations of cars, since keyframing a smooth acceleration is hard.

Why is that hard? Its very easy, I think. Please enlighten me why its hard.

Qexit
09-15-2018, 04:00 PM
Why is that hard? Its very easy, I think. Please enlighten me why its hard.I have no idea. That line is simply a direct copy of the plugin description from the manual which is dated June 25, 1998 :)

Ztreem
09-15-2018, 04:32 PM
I have no idea. That line is simply a direct copy of the plugin description from the manual which is dated June 25, 1998 :)

Ah OK. At that time I can understand it was hard but now the tools are a lot better and its not that hard anymore. :)

jeric_synergy
09-16-2018, 10:09 AM
Yes, but if you use a null for doing so you only transfer the keyframes to that null instead of your object. You don’t really gain anything, sometimes its easy to overthink and complicate things instead of just do it.
I don’t say there isn’t a reason or that you should not do it but you should think it through before you do it.

Another possibility is that the null controlled MANY other items.

I can certainly see how this would be convenient if one were, for example, animating a bird's eye view of a car race with a basically circular track, but not an actual circle. Each car would get a "throttle", and blah blah blah. Of course, by the time you got this system working, you could have animated it w/keyframes three times over.

Still, it'd be nice to know if the overall system is flexible enough to accommodate such constructions.

Ztreem
09-16-2018, 11:47 PM
Another possibility is that the null controlled MANY other items.

I can certainly see how this would be convenient if one were, for example, animating a bird's eye view of a car race with a basically circular track, but not an actual circle. Each car would get a "throttle", and blah blah blah. Of course, by the time you got this system working, you could have animated it w/keyframes three times over.

Still, it'd be nice to know if the overall system is flexible enough to accommodate such constructions.

It is possible and you could use the techinque I showed in my recording. You can link as many objects you want to that animation channel you can even do the animation on a Null object and link all others to that. Whatever you do, if you want to animate the throttle you need to create keyframes and youíre back to square one or you could use a procedural texture to drive the animation without keyframes.

jeric_synergy
09-18-2018, 12:57 AM
It is possible and you could use the techinque I showed in my recording. You can link as many objects you want to that animation channel you can even do the animation on a Null object and link all others to that. Whatever you do, if you want to animate the throttle you need to create keyframes and you’re back to square one or you could use a procedural texture to drive the animation without keyframes.

Ztreem, thanks: I'm housesitting and away from my LW station until Wednesday. I look forward to seeing how this was solved.

Ztreem
09-18-2018, 02:37 AM
I don't know why I do this or why I care but here is a similar setup with a different approach. I just like solving others problems instead of my own. :)

142826

jeric_synergy
09-18-2018, 10:29 AM
I don't know why I do this or why I care but here is a similar setup with a different approach. I just like solving others problems instead of my own. :)

142826

LOL, we identify and appreciate. Other people's problems are more interesting, our own are just frustrating.

++++++++++

On the subject of justifying or rationalizing this general approach: I'm #aflw but, keyframing item positions could be quite finicky and a tedious drag, while speed control along an established track should be a doddle, even though you'd still be keyframing the controller.


Again, #aflw, but has anybody turned on LSCommander to see how much of the workflow gets captured as commands? Ideally, this would be ALL OF IT, and one could set it up with a push of a button (linked to an LSCommander derived lscript).