The player model is a whole chapter in itself and there are many things that can and will go wrong when trying to set one up for the first time:

I'll just point out that this isn't a tutorial on how to use blender and it's tools but rather a tutorial on how to make it work with the Torque engine and what problems to avoid. I will assume that you know how to model, texture and add bones to a mesh. If you don't, go here: Basics


(One of my early tries, this is a rather odd bug as it usually occurs due to some errors in the bone structure. But sometimes a perfectly fine model can come out like this after export, no need to panic though. It's usually just to re-export the model and everything is fine again)

Let’s start from the beginning, the software: I'm using Blender 2.36 for most my modelling works as it seems that 2.37 have some tendencies to screw up the model.

IMPORTANT: In order for everything to work properly I use a "hacked" version of the Blender/Torque exporter made by Walter Yoon wich can be found at: link, without this fix the blend animations wont work properly.

 

Well, then let’s get started!

1. Directions
Open a blank blender file and delete the box in the middle. Then press "7" on your numpad (top down camera) and create some kind of marker, in this case I decided to do a simple arrow mesh.


Now make sure its pointing up when you press "7". This is the direction that the player model will be facing, the reason I'm making this clear is that if you build it facing the wrong direction you will have to do some editing to make it work and all kind of idiotic bugs can be avoided simply by doing this.

 


2. The Mesh

Now build yourself a spiffy looking model, it can be made out of a single mesh or a dozen, as far as I know it doesn't matter. I suggest something simple so that you get the hang of the modelling/texturing and rigging process before you start anything serious. As soon as you have come far enough to know where the front and back is just delete the arrow mesh. (You should see his/her back when you press numpad 1)

Some pointers:
* Build the model with the arms straight out like a scarecrow.
* Make sure to select all meshes and press Ctrl+A now and then to apply the size and rotation (This prevents the model from going a-wire as soon as you apply the bones later on)
* Make sure that there are no "holes" or hidden faces in any mesh. (To prevent the texture from rendering incorrect later on)
* Make extra saves of the .blend as you model so you can go back to a earlier version if you screw something up to badly. (This really helped me several times)
* Export the model now and then to see how it looks in Torque, that way you detect problems earlier.
* Make sure to create a big mesh named "Bounds" surrounding the model or the animations will not work correctly with the ground transforming upon death of the player. (Just to be sure make it big enough to cover all animations you'll do later on)

[Select the "Bounds" mesh and go to the Object menu (F7) and then select "Wire" as the Drawtype (So that the mesh don't render and block your view of everything else)]






3. The texture
* First a friendly pointer: If you created the model with multiple meshes but want them to use the same texture map then fix the UV separately, move them to different locations in the UV editor (otherwise they will overlap each other after you join the meshes) and then join the meshes, DO NOT ADD ANY MATERIALS BEFORE YOU JOIN THE MESHES or the texture will not be displayed properly.

When you fixed the UV map export it.
[Make sure to change the wire Size to "2", it will be much easier to work with in whatever image editor you prefer as the lines become solid, at "1" they tend to be full of small holes that mess things up, at least the way I work with the textures.]

Now make the texture and save it as a .PNG (The standard format for Torque, other formats will work but Torque will just convert them so if you want to keep the size down, optimize the Png)

Open the texture in the UV editor and add a material (F5/ add new):

[ A) Name the material after the .Png you are using, in this case the file is body.png so the material is named "body", check TexFace and add a new texture]


[ B) Go to the Map Input and check only "Nor"]

*Note: Here I'm only texturing the torso but that's just because this model is for the tutorial only and I don't have time to do the whole thing, normally I would texture the whole model as one UV map.



4. Rigging
Time to give our friend a skeleton!

Some pointers:
* Again, select all meshes and press Ctrl + A to apply the size and rotation before adding any bones.
* Start by adding a bone named "dummy" (make sure you don't animate this bone later on, just let it be the first bone of the chain, this prevents the animations from screwing up)
* Add a bone named "Base" or whatever you feel like as the top bone of the bones you animate (yes that means it's second after the "dummy bone"), don't attach any mesh to this bone but rather use it to move the whole model as all the other bones follow it.
* Add two bones named "Ski0 and Ski1" somewhere in the model, these two bones is a must for the ground transform to work when the player dies (Torque uses these two bones to tilt the model according to the terrain when the death animation plays)


* The model needs an "Eye" bone (Tells Torque where to point/place the camera, try not to mess to much with this bone, I'm not sure but I think it can screw up the animations if you animate this bone)
* The model also needs a "Mount0" bone (Tells torque where and at what angle to place the gun). It can be a bit tricky to place and animate this bone right as the smallest mistake can make the gun tilt at a funny angle but as long as you are careful and don't use IK on it, it should work. Just make sure to export often and make extra copies of the .blend.
* A little trick I use is to append (import) the weapon mesh and attach it to the Mount0 bone, then I place it and export to Torque. Now the model will be holding two identical weapons, go back and forth until they sit more or less so close together that they look like one weapon. Now you can see in blender what happens to the gun when you animate the model, just don't forget to remove the weapon mesh before the final export.

Here is my bone setup:

 

 

5. Animation
Time for the tricky part, animation. The basic animation such as run, jump, sidestep etc. shouldn't pose much of a problem. The hard part is the so called "Blend" animation (look, recoil, head, etc.)

I'll try to explain how the blends work:

A. Lets say we use 4 key frames for the "look" animation, place the arms like this:
1. Arm pointing up (First frame)
2. Arms centred
3. Arm pointing down (Second to the last frame)
4. Copy the arm pose from the "root" animation (Last frame)

(The last frame won't be exported due to Walters's fix in the exporter, instead it will be used as the reference frame for the rest of the animation to blend upon)


B. Next make the "Recoil" animation, again we use 4 key frames:
1. Arms centred (first frame)
2. Arms recoiled
3. copy the first frame (second to last frame)
4. Copy the arm pose from look animation (last frame)

(Again, the last frame won't be exported due to Walters's fix in the exporter, instead it will be used as the reference frame for the rest of the animation to blend upon)



Pointers:
* Try to use only the bones needed in every animation to avoid collision between the animations.
* If you have a channel with no key frames in it, the export will fail, the error message will say something about Ipo curves. Just go through the animations and delete all channels without key frames.
* Set all the #GRND frames to 0 on export except for the death animations where anything greater then 0 works. (As far as I know this is because the death animations are the only animations that use ground transform, remember the "Ski" bones?)
* Make sure you check "Blend" on all the blend animations and "Cyclic" on all animations that will be played repeatedly (run, root etc, animations that just play once, like "jump" isn't cyclic)

Well, that's all I can think of right now. I spent ages figuring this out and nearly hanged myself several times but thanks to the Garage games community and some helpful members I've finally made myself a couple of working player models 100% made in blender. I hope this will help people who struggle on the same things as I did, don't give up! ;]

Best regards // Jove

Main

The basics

Playermodel