Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel
Legacy:Weapon Modeling With 3dsmax
- Tutorial Goal
- This is an advanced tutorial that will walk you through taking a weapon model from 3D Studio Max to UT2004 and getting the weapon fully functional by using UnrealScript.
Disclaimer: This tutorial was written using UT2004. Some code may not work properly in UT2003. You have been warned. ;)
- You know how to model in 3dsmax and can create your mesh and texture on your own or have one already made.
- You know the basics of 3dsmax
- You know the basics of UnrealScript and can compile
- Your weapon is similar to one of the weapons already in UT (for simplicity)
- You have all of the tools required
Once you have your weapon model finished and textured, you must choose between two different animation types. Vertex animation is the simplest to create in 3dsmax, but UT2004 has complex import methods for this type of animation. Skeletal animation is done very similar to player models. You make bones relative to how you would like your weapon to animate. There is a catch here too: to animate a cocking motion, such as a pistol slide, you must use Inverse Kinematics (IK) to allow the slide bone to stretch and compress. Skeletal animation was used in the example. Here’s how to make the bones for the example:
- Select the bones tool from the prefabs page, systems tab
- Click to place your first bone (the root) then click where you want each joint
- Be sure to place bone ends where you want the muzzle flash to go
- For the example there are only 4 bones: one root, one connector, one slide bone, and one flash bone.
- (link to example pic, bones)
- Now you must rig your weapon to the bones in much the same way as a player model would be rigged
- See Player_Modeling/3dsmax_Tutorial for specifics on rigging
- I would recommend using vertex assignment exclusively as envelope is meant for more organic movements
- The example was rigged in only 2 places: the bottom half was rigged to the root, while the slide was rigged to the flash bone ( this prevents the mesh from "squishing" when the slide bone is compressed)
- To get the slide to... slide you must apply a specific type of IK called History Dependant (HD)
- Select Animations menu > IK > HD
- Select the first bone you wish to apply IK to
- In the example the root bone was selected
- Select the last bone in the chain
- The slide bone in the example
- This makes these bones an IK chain and you can now drag the IK crosshair to place the end bones
- On the movers(?) page there is an IK rollout, use this to edit the IK properties of each bone in the chain
- The example locked all rotation axes and only allowed the slide bone to slide along the x axis
Because of the use of IK and Forward Kinematics (FK) on the root to simulate recoil, you weapon may appear to "fall apart" and leave the IK bones and rigged mesh behind. This is caused by 3dsmax trying to work in two different directions at once. Follow these steps to animate your weapon properly (all animations are at 30 frames per second):
- The firing animation is typically the most complex and will be tackled first
- In the example the slide was animated alone first
- Change the animation slider to go from 0 - 7(?)
- Select the whole scene [ctrl+a] and click Set Key Frame(?)
- Click auto-key(?) and drag the animation slider to frame 3(?)
- Drag the IK crosshair to where the slide would be for fully cocked back
- Drag animation slider to frame 7
- Drag IK crosshair back to starting point
- test play the animation
- You should see your slide kicking as if a shot were fired, but there is usually some recoil with weapons.
- To animate the recoil rotate the root so your weapon rocks back as if fired on the last frame of your slide animation
- You can also have the weapon move back and a little up fore more kick
- Expand the animation slider range to fit how long you wish your fire animation to be
- Place more key frames for the recovery and place the weapon back in the starting position on the last frame
- The slide will likely position itself strangely during these animations as you have not adjusted the crosshair for the recoil
- Simply move the crosshair with auto-key on and adjust your key frames accordingly
Any alternate fires that require animations are created in much the same way. The other animations UT2004 uses for weapons are Select (when the weapon is selected), Idle, and PutDown (when another weapon is selected). These animations can be done on the same animation slider, just use later frames.
Exporting the mesh and animation:
Tarquin: It's best to only use subpages for groups of pages that are part of one document. I suggest renaming this to Weapon Modeling with 3dsmax, and doing the same for the player modelling tute.
Syntax_Error: Will do Tarquin. Thanks for the suggestion.