#3-2 : Preparing a model for riggingPreparation and alignment introSo, before we rig the model, we need to make sure it's the correct size and in the correct place relative to the base human. This should work in any 3D software. I'll give a quick and simple explanation for Wings3D, but you should be able to do this in any 3D modelling application. We're only really using the size and move commands.
Basically our overall aim here is :
- Take the correctly aligned reference model
- Import the model to be rigged
- Resize and move the new model, so it is in the correct place
- Check it for any clashes with the human model
- Re-export, ready for rigging.
Files for use hereIf you're following along with this, download these files. I'd recommend you take the aligned human one anyway.
3-1 Aligned human.obj (New link 22/01/2012)misaligned beret and texture.zip (contains 3-2 beret wrong place.obj and armor_all_beret.png)
(New link 22/01/2012)Using Wings3D to align the modelOpen Wings3D. It'll look roughly like this :
[edit] If you don't have the "Outliner" and "Geometry Graph" on the right hand side, they can be activated from the "Window" menu at the top.
Brief overview of controls and layoutThis is just an explanation of controls. Skip if you already know them, or are using different software.
A thorough breakdown of controls can be found in the manual or in any "how to use this program" tutorials, but I'll cover a few bits for clarity.
Mouse and keyboardKeyboard ControlsA : Focus camera onto selected face/vertex/object(s)
Space Bar : Deselect all
X,Y,Z : View along x,y,z, axis
SHIFT + X,Y,Z : View along reverse x,y,z axis
TAB : Enter a specific number for size/move/rotate etc
Mouse controlsLMB : Select / Deselect
RMB : Open context specific menu
MMB (press on mouse scroll wheel) : Switch to rotate camera
Scroll wheel : Zoom in / out
These can be customised in the options for those with more/less/other buttons in the preferences.
Program layoutSelection optionsSelect vertex, edge, face, object
Relating to LMB selecting, whether you wish to select vertex, edge, face or whole object. Clicking on part of the model selects or unselects. You can also drag a selection box around several.
Viewing optionsPreferences, smooth/flat shading, perspective/orthogonal, grid on/off, axis on/off
OutlinerOutliner shows materials and textures. You can drag and drop textures onto materials, right click on materials to assign them to selected faces or objects or edit their preferences.
Geometry graphGeometry graph shows objects (hide, lock edit, view as solid or wireframe).
General usageSome modelling programs use a series of "modifiers" which are then applied, or can be changed back easily at a later date. This is not the case here - you just click "make bigger" or "flip" etc. Move the mouse to increase / decrease, or use TAB to enter a specific ingeter.
Generally, the program uses a context menu system. Select a face or object, then right click to do something to it. Each menu option can be clicked with LMB, MMB or RMB for different levels of manual control. These options are shown in the information line. With nothing selected, you will have the option to create any of the default primitive shapes (i.e. cube, cylinder etc). Additional keyboard commands will also be shown in the menu.
The information line will tell you any necessary info, including what your current context specific options are. Generally speaking, LMB is the "basic default option", and the MMB and RMB ones are the more specified custom ones.
Further controls can be found in the manual, or any general usage tutorials. For what we actually need to do know, the current information should be plenty.
Aligning the hat modelDifferent 3D programs use different default scales, rotations and setting upon export, so you might find that models are laying face down, or really small etc. To work with this, we're going to import a "correctly aligned man" (he's simply an .obj export from the CR_HumanMaleStrong.x which had been imported into Fragmotion). If we then adjust our model to match him, and export through Wings3D and Fragmotion, he should end up in game at the correct size and stood upright.
Firstly, import our "correctly aligned man"
FILE > IMPORT > OBJ > select file > 3-1 Aligned human.obj
You should end up with this guy here. You may need to zoom out (mousewheel down)to see him. You should have one object (Default Body) in the geometry window, and a selection of materials in the outlines. Though we don't need these right now, these materials correspond to the subsets on the main model.
Now we want to combine this with our hat we want to rig.
FILE > IMPORT > OBJ > select file > 3-2 beret wrong place.obj
You should have this guy there now, wearing a rather poorly made little beret. He's also too small and in the wrong place. If you're working with someone else's files, this will often happen, so you need to know how to correct this. If you cannot see the little man, you can use the mouse scroll wheel to zoom out, and the press-down-scrollwheel to turn into "rotate camera".
So, firstly let us select the little man. Either click
Beret and
Body in the Geometry Graph, or use the "Whole object select" button and drag a box round the little man and his hat. If you press the A key, it will focus the camera onto the little man. You can now rotate and zoom from this point.
NOTE :It's preferable for someone to export an armour object with a "base human" attached, because it allows us to "match the humans" like this, thus ensuring the armour is in the correct place. If the armour is on its own, you will have to adjust and resize "by eye" only.
Resizing and rotating multiple objectsNote that the beret and small man are built from two separate objects. This will have an effect on our resizing and rotating tools - namely that if we resize / rotate in "object, edge or face" modes, each object will separately resize or rotate from its own centre point.
In object mode, his hat and body resize about their own centres - so they stay in the same place, and resize "into" each other.To compensate we can either :
1) Resize / rotate in vertex (little dots) modethis will adjust the objects as one whole, so the hat stays on the head, in its relative position.
2) Temporarily combine the objects (select both, RMB > Combine)If there's only a couple of objects, this will work fine. We can separate and rename them later. However, if the model is made of lots of smaller pieces, this could end up very messy.
3) Resize / rotate from a specific pointWe can use the advanced commands to specify a point to resize or rotate from. If for example, you select the bottom of both feet as this point, everything will scale from this point, keeping the different objects in the correct place.
In this case, I'm going to just use the vertex mode.
NOTE : In many cases, you may be able to do this very quickly by using the "align centre", "put on" "absolute commands" and other similar options. The following is not the quickest way to do this, but it is easier to follow and the "essence" of the instructions should be transferrable to other programs relatively easily.
Moving and resizing commandsFor this specific example, the following series of commands should get you roughly in place. You might want to tweak things a little further yourself. Note that you can press the TAB key to enter a specific value. They're all the default LMB commands.
- Select beret and small man
- Switch to vertex (little dots) mode
- Scale Uniform 1000%
- Move Y (up) about 58
- Rotate Y 180
- Move z (back) 43
- Move x (sideways) -113
This should get us roughly into place.
If you click on the little "blocks" on the right side of the Geometry Graph (view as solid/wireframe), you can switch each object to wireframe mode and back, which should help to see the alignments. Basically, you want both of the human models to overlap as closely as possible.
Continue making minor adjustments to the scale and position until you feel the bodies are overlapping closely enough. If you can get most of the red (selected) and black (non-selected) vertices to be in the same place, you should be fine.
Removing spare bits and checking for clashesSo, assuming that worked, we can delete the 2nd body, just leaving us with the default body (from "correctly aligned man) and the hat
- Press Space bar to deselect everything
- Select the Body object by clicking on the left hand cube in the geometry graph
- Press the delete key
We should now have the hat placed on the alignment man. Me may want to check for further clashes - occasionally you will find from certain angles that the head sticks through the top of the hat, for example.
Adding the textureIt's a lot easier to spot these clashes if one of the objects has its texture attached, so will go through this now.
File > Import image
Select the armor_all_beret.png, which should now appear in the outliner window.
Switch to "Object Mode", then select the beret object.
Pick a material - you likely have a few default ones (if not, right click on one and duplicate it). Select it in the outliner, right click and rename to "beret" or similar, then right click and "assign to selection".
Next, drag and drop the texture onto the beret material and select Diffuse. If the texture doesn't appear on the model, right click the material settings and set the vertex colours to "ignore".
Hopefully, the hat should be coloured in red. Zoom out, rotate and check from various angles that the head does not protrude through the hat. Sometimes it's useful to turn the object into wireframe and see if there are any vertices or edges which are too close to the edge of the hat. You may have to increase the size slightly, or slightly move individual edges, faces or vertices to make things fit. "Move face normal" may be useful for this.
Obviously, if you wish, you can drag textures onto the base human model to see roughly what things will look like.
Exporting itNow we've got the beret in the correct place, with material and texture attached, so can now export it.
Select the beret object, then go to : File > Export selected > obj
Make sure to pick "Export Selected", or to delete the alignment man and his materials, else you'll end up with the whole lot in your hat file.
This obj file is now aligned correctly to the "base man", and therefore his skeleton, so we can import it into Fragmotion and rig it quickly and easily. Remember, you can use your preferred 3D program, though there may be a matter of "export scale" in some programs. If someone can test in Blender, Max etc we can find this out.
Regarding the files made so far, here's one I made earlier :
Beret export selected.zip (contains obj, mtl and same texture file)
(New link 22/01/2012)This is the correctly aligned beret file.
Though I've used the hat in this example, the process is essentially identical for any other armours etc.