|Character Editing Tutorial|
|Here I am writing a tutorial on how to get your new characters ingame using Blender and Hollower's excellent import/export script. You can get the latest version of Blender from here, and get Hollower's script from this topic.|
First of all I am going to explain the main parts of rigging your model, then run you through the steps on how to rig it.
|Shortcut keys to use in Blender|
|A - Selects/Deselects everything that is currently on the screen.|
B - Use this to select objects or vertices with the use of the mouse.
R - Rotates the current selected object(s)/vertice(s).
S - Use this to scale objects and vertices.
MouseWheel - Zoom.
CTRL + MouseWheel - Pans the view horizontally.
SHIFT + MouseWheel - Pans the view vertically.
NumPad Arrows(2, 4, 6 and 8) - Rotates the view.
NumPad 1 - Front view.
NumPad 3 - Side view.
NumPad 5 - Switching between orthographic and perspective views.
NumPad 7 - Top view.
|Running Hollower's Script (GTA_IE_01c.py)|
|To run the script you need to change the current window view. You'll notice this little button on the screen:|
if you click on it a pop-up menu will appear, select "Text Editor". You should be looking at a blank grey screen. Now you can open the script by selecting it from the File->Open menu. Once the script is open you should see text on the screen, to run it either press ALT+P or select "Run Python Script" from the File menu.
|The Import/Export Tool|
|After running the script you will see a new window, this window is, as you can see, where you import and export your model. Here is a quick explanation of everything you see on the screen:|
FileName - Your DFF model filename. (On export your model will be named the current filename along with a number e.g. Cop.dff would be exported as Cop1.dff, if CopX.dff exists then it will be named with the next number)
Texture Path - Where the texture is found(NOTE: It's easier to have the texture in the same path as the DFF).
Import - Imports the selected model.
msplit - Material Split, press this button if you exported the model from Zmodeler.
bpatch - This is used to make a bone patch(*.bp) file, which is used in the exporting of a model. These bone patches are made by importing an original Vice City player or pedestrian model.
Export - Exports the selected mesh.
Presets(Pop-up Menu) - In this case you would select "VC Human".
uvtex, prelit, modulate and normals - No need to worry about these.
z-lock - This adds a Zmodeler-Lock to your model (Not recommeneded)
|Different Modes in Blender|
|There are a few different modes in Blender that you will need to use, these include "Object Mode", "Edit Mode", "Weight Paint" and "Pose Mode". Here is some brief descriptions of each mode:|
Object Mode - Similar to Zmodeler's object mode.
Edit Mode - This is where you edit the model, create vertex groups, etc. Similar to vertices mode in Zmodeler.
Weight Paint - This mode is for Bone weight, here you adjust the strength of vertices in each vertex group.
Pose Mode - When the skeleton(armature) is selected you can switch into Pose Mode and see how the model deform's when parts of the body move.
|Opening The TommySkeleton|
|To open Hollower's TommySkeleton select "File->Append..." and select TommySkeleton.blend from the same folder as the script, once you click on the file you will see a list, select Object, then TommySkeleton and then load it by clicking "Load Library". You will now see a skeleton which is refered to as an armature, this is needed when exporting a custom model.|
|Parenting is one of the important parts of rigging a model. Parenting is needed to make the main model the parent of the Root bone and TommySkeleton the parent of the main model. To parent an object first select the child(eg. Root bone) by right clicking on it, then, while holding down SHIFT, right click on the parent(e.g. main model). After that select "Object->Parent->Make Parent...". If you are parenting the main model with the Root bone then select "Make Parent..." from the pop up menu, but if you are parenting the TommySkeleton with the main model then select "Use Armture" then select either "Name Groups" or "Create From Closet Bones".|
|Vertex groups are a set of vertices assigned to a vertex group/bone, these vertex groups determine what parts of the model moves with the corresponding bone. If you selected "Create From Closet Bones" when parenting then Blender automatically creates the vertex groups, but you are not guaranteed a great result. Here is an example from the cop. The vertices that are selected are assigned to the "R Upperarm" vertex group:|
When an animation ingame moves the right upperarm these are the vertices that move.
To create vertex groups first select the vertices that you want to assign to a vertex group. Then find this, the red parts are important:
Time for more explanation:
Weight - The level of bone weight for the selected vertices. This is used when the vertices are assigned to a group.(You are best not to use this, "Weight Paint" is better to use)
New - This is used to create a new group(not needed).
Delete - Deletes the current selected vertex group name(not needed).
Assign - Assigns the selected vertices to the selected vertex group.
Remove - Removes the selected vertices from the selected vertex group.
Select - Selects the vertices of the current selected vertex group.
Desel. - Deselects the vertices of the current selected vertex group.
After you have selected the vertices you want, "Assign" them to the correct vertex group.
|Bone weight determines how strong each vertice moves ingame. Bone weight ranges from 0.000(blue) to 1.000(red). Sometimes you can be lucky and not have to edit the bone weight, but it's recommended that you do to get the best result. Here is an example of what bone weight looks like in Blender:|
To adjust the bone weight you would enter "Weight Paint" mode. Once you switch to that mode you are able to select any vertex group to view/edit it's current bone weight. To paint the weight onto a model all you do is click on the part of the model you want to paint. To change the strength you would adjust this:
Have a look at an original player or pedestrian model for help with bone weight.
You should take your time with bone weight and try to get it perfect for the best result.
|Pose mode is used for viewing the movement of your model, it can be of good use when you have created your vertex groups and edited the bone weight. Here's an example of what Pose Mode looks like:|
It's easy to use, just right click on the part you want to see move, then use rotate to move the selected body part, once you are finished viewing the movement right click to stop the rotation.
|1. Setting Up Your Model Before Importing|
|Before importing your model you should do the following:|
1. Set your model in the same position as an original player/pedestrian model.
2. Make sure your model is one mesh/object.
3. Name the mesh Root.
4. Make sure your model has one texture.
5. Make sure your model and it's axis is centered (there is a chance of the model appearing sideways ingame if you don't).
|First you should import an original model, preferebly Tommy, so that you can import the bones and make the bone patch file. After you import Tommy switch back into 3D View and delete Tommy's mesh (right click and press delete). Now go back into the Import/Export Tool and import your model, remember to use msplit.|
|Before loading the TommySkeleton you should make the main model the parent of the Root bone (I have already explained how to do it). Once you have made the main model parent you can now open/append the TommySkeleton. Does your model match TommySkeleton? If not you should edit the model until it does. If it does match then you can continue. Right clcik on the model then hold down SHIFT and right click the TommySkeleton. Both the model and the skeleton should be selected, but the skeleton should be a lighter shade of pink. Now make the skeleton the parent of the model, you can select "Name Groups" or "Create From Closet Bones", I would recommend using "Name Groups" so you can get the best result.|
|3. Creating Vertex Groups|
|Now it's time for you to assign every vertice to the correct group. Easiest way to do this is to zoom right into the section of the body you are working on. |
Remeber to use Pose Mode.
(Reminder - I have already explained how to create vertex groups).
|4. Editing Bone Weight|
|After you have assigned every vertice to a group you can now work on the bone weight. This is the part where you MUST take your time so you get the best result. Remember to use less strength on the model's joints.|
|5. Making sure that the model is ready to export|
|At this point you should check to make sure that you have done everything correctly. The best way to see is to use Pose Mode, and move every part of the body to see if they rotate properly.|
|Before you export your model copy the bone patch file, that was made when you imported an original model, to the same folder as your custom model. The bone patch file will be found in the same folder as the original model that you had imported earlier. Make sure you rename it to the same as your model filename (e.g. myplayer.dff, bone patch file would be named myplayer.bp). Again before you export make sure the filename is your custom model and you have "VC Human" selected in the presets. Now you can export your model. When you click export you should see this message(if it went successfully):|
Loading bone patch: c:\example.bp
Exporting 1 meshes, 24 dummies
X bytes written to c:\example1.dff
If the message is different then you have a problem, check if you done everything correctly then try again. If you still have a problem then post here with the exact message so I (or anyone else) can help.
|7. Import to GTA3.IMG|
|If everything went smoothly then you can import your model and test it out ingame. If the model has a problem ingame and your unable to fix it then post here with an image of the model ingame so I can see the problem. If the model works perfect then well done.|
If you have problems post them here and I'll try to help.
Good luck and enjoy.