To start with you have 2 Options
1) Make a Biped Rig that matches that of Kork, and functions using the same animation .dsq files – This is Part 1
2) Make either a Biped or your own Rig with your own inbuilt animations – This is Part 2
Part 1 – Choosing Option #1
If you have decided to go for option #1, using the Kork animation .dsq files then from what I have discovered you must not only match your skeletal rig exactly to the Kork rig, but something that is just as important is to match the actual scale/size of your rig. I started a thread in the forums regarding this topic and Logan Foster has a great explanation to this,
‘If the scale/size between your DTS and DSQ do not match, the engine will try to do its best to make it adjust, which is why you will see wierd things like you are with the Z height of the DTS in the game world changing (because the DSQ is taller or smaller than the rig used in the DTS), or even more subtle things like the model getting squashed or stretched oddly (because the size of an individual bone does not match between the DTS and the DSQ).’
This having been said, the process is rather simple (that is considering you have a basic understanding of DTS structure & hierachy setup in 3Ds Max) So lets jump straight into it!
Preparing your Mesh
Firstly lets deal with the scale of your mesh. Kork stands 2.2m tall, the ForgeSoldier stands 2.4m tall, and the ElfSorceress stands 2.2m tall! But matching the height is not the critical issue here… it turns out that it is actually matching the ‘Bip01′ height. This height sits at exactly 1.3m, so that must be the position of our hips. My character turned out to stand 2.585m tall simply to get his hips to be around the 1.3m area. So I suggest that you make your character have a hip height of 1.3m (simply to match that of the other Torque Characters! So import your character into max and with your unit system set to Meters place your model so that he/she is standing on the origin. Then scale its height to fit.
*Your model should be facing down the Y-axis, so when you look at it from the Front View you will be looking at its backside*
Secondly we need to reset the models XForm! I am assuming you have fully completed this mesh and that collapsing the modifier stack will not be a problem. With the model selected click the ‘Utilities’ tab (the hammer) and then click ‘Reset XForm’ and then ‘Reset Selected’. This will apply a XForm modifier onto your mesh, at this point I will automatically right click the mesh and ‘Convert to Editable Mesh’ this maintains the Reset XForm, but collapses the stack and gets rid of the modifier!
Creating the Biped
Lets move on to creating the Biped Skeletal structure
- Click the ‘Create’ and then ‘Systems’ tabs and choose ‘Biped
- Drag the Biped in the ‘Front View’ out, starting with your mouse at the origin (0,0,0) and drag upwards until the over all Biped matches the height of your mesh, that’s the first important scale reference! The second is to make sure that the ‘Hip’ joint is placed as accurately as possible! That said, if the head doesn’t quiet match your mesh because the hips are correct rather preference the hip placement over the head height.
- As soon as you drop the Biped, you must now setup the basics for your Biped. In the right toolbar setup the following
- Spine Links: 3
- Figures & Toes are dependent on your model, mine will be set to 3
that’s it, now its time to pose the Biped to match the pose of your model
- Click the ‘Motion’ tab, then the ‘Figure Mode’ button, this puts you into a mode that allows you to pose the Biped skeleton
- First things first, select the ‘Bip01′ node and rotate the Biped to match the direction of your model (generally this is a 180 degree rotation), whilst here make sure it is on 0, 0 on the X, Y axis.
- I like to work in Symmetry when posing my models, so after selecting a bone on either side I turn on the ‘symmetrical button’ which will select the opposite bone and the two will now rotate together. This will only work correctly if your rotations are set to ‘Local’.
*never rotate the knee in the front view, the knee joint never bends sideways*
- I generally try to avoid scaling bones as much as possible, however it is in most cases required. It can be done by simply switching to the scale option and scaling symmetrically across the X axis.
So working back and forth between rotating and scaling, and the front & left views, match the Bipeds pose to that of your Mesh. This entirely done whilst in ‘Figure Mode’
Adding the Skin Modifier
- Select your Mesh and in the modifier stack add a ‘Skin’ modifier.
- Select the ‘Add’ button, this pulls up the standard max selection window. From here I deselect the ‘Bone Objects’ in the ‘List Types’ section, and then hit the ‘Invert’ button. That in turn shows me only the usable bones in the scene.
- You need to select all of them, but don’t choose ‘Bip01′ that must not be part of the skin
- Do your weighting till you are satisfied, and make sure you have a weight assigned to all vertices , or you will get an error when you export. (Mostly I skip this step until I have proven my rig)
Setting Up the LODs
I expand this section at a later date. Currently I am only setting up a single LOD. There are methods to creating LODs using the multires modifier, Click Here!!
- I create dummy node, by going ‘Create’ -> ‘Helpers’ -> ‘Dummy’. I normally try to keep my scene neat by placing this node at the orgin.
- Name the node, ‘detailsXX’ where XX is the size of the mesh. In my case ’60′
- At this point I also name my skinned mesh to ‘CharacterNameXX’ or in my case ‘Skinny60′
*make sure you don’t use the sizes of 1 or 2, these will clash with the spine bones and will export the bones as mesh*
- ‘details60′ or your details node, must now be parented to your ‘Bip01′ node.
Adding the Bounds
- This is simple, create a standard mesh box.
- Place is at the origin. (0,0,0)
- I prefer not to scale the box to cover the entire model, but to actually change the box’s Parameters. Then ‘Convert to Editable Mesh’
- The next step is simply for scene management. I right click the bounds and select ‘Object Properties’ and set its display properties to ‘Display as Box’, then click OK
- Then we need to name this box to ‘bounds’ and parent it to ‘Bip01′
- many people have said to change the ‘inheritance’ settings on the bounds, but so far these have only caused me problems*
Setting Up Critical Nodes
- Create a new Dummy Node and call it ‘Unlink’, place this where you would like your ‘Cam’ node, the duplicate this Node and name it ‘Cam’. Cam is used for the 3rd person camera.
- ‘Cam’ is then parented to ‘Unlink’ and ‘Unlink’ is parented to ‘Bip01′
- Duplicate ‘Cam’ and call it ‘Eye’, this is for the first person camera. Place this node, and then parent it to the ‘Bip01 Head’ bone, this will make the ‘Eye’ node move as if it where attached to the Head.
- Duplicate ‘Eye’ and call it ‘Mount0′, this is for weapon mounting. Place this node at the Left Hand and parent it to ‘Bip01 L Hand’
Exporting & .cfg files
My dtsScene.cfg file (which must be stored in the same place as your saved .max file) is pretty simple at the moment it simply has
AlwaysExport: Eye Mount0 Mount3 Mount2 Mount1 Light1 Light0 Unlink Cam NeverExport: NeverAnimate:
inside it, however see jokersgrin’s version Click Here!!
Other than that, its as simple as exporting your Mesh. I prepare for the unMessDTS stage by exporting two meshes (only on the first export)
- Export to the location you desire and name your DTS, ‘character.dts’
- Then export it again as, ‘character_mess.dts’
- That it, from now on, you will only ever have to re-export over the ‘character_mess.dts’ version as the next step takes care of the rest
*remember to load into the engine the DTS file called, ‘character.dts’*
For some reason unMessDTS is a critical step in creating a skinned mesh. Here is my suggested work flow for this!
- Unzip the pack to your Max/Scripts directory
- Run the unMessDTS script in Max
- Point it the unMessDTS.exe
- Point it to your ‘character_mess.dts’
- Point it to your ‘character.dts’
- Then hit ‘unMess Shape’
- That’s it!
*whats awesome is you can leave the unMessDTS script window open and carry on working and exporting from max, then just hit ‘unMess Shape’ again*
Your skinned character should now be ready for testing in the Engine!
Whilst trying to figure this process out, I used a few good references and picked out the info I needed! See the links below
- ZBuffer & Sorting Issues on Vehicles in Torque
- Orphaned Polygons in Torque – Part 3 of 3
- Orphaned Polygons in Torque – Part 2 of 3