PDA

View Full Version : Auto Bank



zander
11-24-2003, 09:54 PM
Hi,

This topic popped up in a thread (http://vbulletin.newtek.com/showthread.php?s=&threadid=13945) in the Mac area. The questions was, "is there an auto bank function in Lightwave?" The answer seems to be no...

You can set the Heading and Pitch to "Align to Path", but the Bank has to be hand-keyed if you want to give it a "Flying" look.

Well, I wrote a Layout Lscript to simulate the banking that you would typically see in a helicopter/steady-cam shot. (It's not real physics. I'm just taking differences in the heading from frame to frame. But, it seems to work okay...) I thought I would post it here and see if anyone can improve it or offer suggestions.

--------

There are 3 options that you can set in the UI:

Look Ahead Frames: (Default = 30)
The number of frames to look ahead.

Samples: (Default = 30)
Number of samples to average. (So, if you're at frame 0, it will look at the heading at frame 15 and frame 30. Subtract from the current heading and divide by the number of samples.)

Ratio: (Default = 0.75)
The bigger the number, the more banking. (If the heading has changed 10 degrees from frame 0 to frame 30, then the bank would be 10*0.75 = 7.5)

--------

To install:
1. copy this script into your Lscripts>Animate folder.
2. In layout, scan for plug-ins.

To use:
1. select an object.
2. Bring up the Motion Options window ('m' hotkey.)
3. Select Add Modifier>Auto Bank. (You might want to set Heading Controller to Align to Path while you're here.)
4. Add some keyframes.
5. Press play.

--------

Feel free to modify. Please share any cool updates. Enjoy!

hrgiger
11-24-2003, 11:37 PM
Zander,

I tried to run the lscript and this was my error...

Steve

zander
11-25-2003, 07:07 AM
Very odd. Line 32 is just the "@script motion" pragma. It tells Lightwave that it's a Motion Modifier script.

And, you were trying to add it from the Motion Options panel?

hrgiger
11-25-2003, 02:07 PM
Sorry Zander. I just figured out I didn't add it through the motions panel, I just tried to run it from the lscript tab which of course doesn't work. That's what you get for not reading instructions. I loaded it up and it worked just fine.

zander
11-25-2003, 09:48 PM
No problem. I'm still new at Lscript programming. There are probably some things that I could do to make it more user friendly. :)

So, what do you think? Any constructive criticism?

hrgiger
11-26-2003, 02:37 AM
It seems to work pretty well. I'm not expert on flying animations though so take that for what it's worth. Also, I probably couldnt' help you because I'm not yet even to the point of giving the user options like you have in your script yet.
I'm just getting into scripting myself. I also just started school for computer programming. I'll be doing a lot of physics math in school so perhaps in a few more years I could tell you how your script stands up to the physics part of it. But for right now, I'll settle for your script.