1 Tutorials LightWave 3D Expression Basics: Rotating a Gear Qua Jan 26, 2011 2:17 am
Admin
Admin
Download source files here. |
I've been using LightWave 3D® for many years now and Expressions have always been something that I considered too technical, something that I'd give my math friends to work on. It wasn't until recently that I found out that it's quite simple to use expressions for many things. This tutorial will walk you thru setting up a basic expression that will help speed up animating gears on a Mech. I promise this wont hurt. |
Creating an Expression: |
Step 1: Load "Crunk_Raw" from the source files. Our goal in this setup is to have the gears automatically rotate when the Thigh "Crunk_rightthigh" is rotated. The lower gear "Crunk_Gear01" is already setup to rotate by being parented to the thigh. We can do this because the lower gears pivot point is in the same place as the Thigh. The upper gear "Crunk_Gear02" doesn't share the same pivot point and needs to rotate in the opposite direction. You could manually animate the upper gear but using an expression will save you the hassle. Step 2: Select "Crunk_rightthigh" as the Current Object. Step 3: Open the Graph Editor by clicking on the Graph Editor button. (CTRL +F2) Step 4: Click on the Expressions menu tab located under the graph display. Step 5: Click the button labeled "New" and give it a name. I chose to name mine "Gear_02". Step 6: In the Value field, select "Value" and replace it with "-". The "-" will make the gear spin the opposite way of the thigh by giving it a negative value. Step 7: We want the Gear to spin the opposite way of the Thigh by giving it a negative value of the Thigh's Pitch. The "-" makes it negative, now all we need is the Pitch value of the Thigh. From the Channel List Choose "Crunk:Crunk_rightthigh.Rotation.P". Step 8: Right-Click and Choose Append to Expression. The Value Fieldld should look like this: Congratulations! You have just written your first expression. Now that wasn't so hard was it? All we need to do now is apply this expression to "Crunk_Gear02" and we'll be finished with the setup. Let's continue. |
Applying an Expression: |
Step 9: Now that we have our Expression let's apply it to the Gear. From the Channels list select "Crunk_Gear02". Step 10: From the Channel List Choose "Crunk_gear02.Rotation.P". Step 11: Click Apply. Note: A small dot is placed next to the channel to let you know that it has an expression attached to it. Let's take a look at what happens when we rotate the Thigh. Step 12: Close the Graph Editor window and make sure that Auto Key Create is selected. Step 13: Select "Crunk_rightthigh" as the Current Object, and rotate it's Pitch. Crunk_Gear02 should rotate on it's Pitch in the Opposite direction of Crunk_Gear01 and Crunk_rightthigh. Well, there you have it. Your first expression applied and in action. I told you this was going to be easy. We've only scratched the surface on the power of Expressions in LightWave. Check back in the future for more tutorials about Expressions. Until then, experiment and see what useful setups you can come up with. Now it's time for a cold beverage of your choice. |