Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 68 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD2 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Blender to Call of Duty 2 xmodel export script tutorial
Versions: You must be logged in to view history.
A tutorial on how to use the Call of Duty 2 .xmodel_export script for Blender. Shows how to get a simple table model into Radiant.

How to export a static model from Blender into Call of Duty 2

Many thanks to roterbaron (www.wesoco.de  - I can’t get into the site anymore because it is password protected now) for inspiring me to look at the guts of an xmodel_export file.

Thanks to Don HO for developing Notepad++; an invaluable tool.

The Blender 3D team for an amazing app.

And, of course, all those who bothered to ask and ANSWER questions on the different forums.

This tutorial assumes that Call of Duty 2 and the COD 2 mod tools are installed correctly and that the reader has a fair working knowledge of those tools and Blender.

The script was tested using Blender3D version 2.48a on a Windoze XP Home system and also version 2.46 on Vista Home Premium.

This tutorial shows how to export a model of a table from Blender to Call of Duty 2.

Preparation

Download the BlenderToCOD2ModelTut zipped folder here and save it on the desktop.

Unzip the folder and open it. Inside are the aatable folder and the COD2_xmodel_exporter.py script

Put the COD2_xmodel_exporter.py script into the …/Blender Foundation/Blender/.blender/scripts folder.

*****If you don’t want to go through this tutorial step-by-step, put the aatable folder into the Call of Duty 2/model_export folder. It contains the files already. Just skip to the section on exporting the mesh from Blender.*********
 

In the Call of Duty/model_export folder, create a folder called aatable.

I prefer to have the extensions of all files visible.
Open Notepad and type the word “placeholder” (or anything you like – it‘s just placeholder text).

Save the file as “aatable.xmodel_export” inside the aatable folder. Doing this makes things easier at the exporting stage. Make sure to include the quotation marks, as it makes Notepad more amenable to saving with a file with a non-ANSI/ASCII extension.

 

Texture file creation

In GIMP or another image program, make a texture. Blender does not play nice with Windows Bitmap (.bmp) files on my system, so I tend to use JPEG or TIFF formats. The texture should have power-of-2 dimensions (eg. 2x2, 4x4, 8x8, 64x64, 128x128, 256x256 etc.). The example texture included with the COD2 mod tools is 2048x1024 pixels.

 For the purposes of this tutorial, I’ll use a small wood texture – nothing special, just 256x256 pixels jpg-  available here.

 Save the texture file as aatablemat.jpg in the aatable folder.

Mesh creation in Blender

Open Blender3D and go to the front view (NUMPAD 1). This is important in order to get the model to show up correctly in Radiant. The Z axis of the view should be going from bottom to top of the screen and the X axis from left to right. This means that the Y axis is going away from the viewer into the screen.

Each unit in Blender represents one unit in Radiant (i.e. one inch). To see each individual unit in Radiant, set the grid size to 1, which will give one unit = one inch, but is a bit too big to work with.
Create the table mesh.
I created the table top and the four legs as separate objects. The Call of Duty xmodel export script can handle multiple objects in a scene.

Once you have the shape that you want, enter Edit Mode, select the faces of each object and convert the mesh into triangles. Call of Duty 2 Asset Manager, Radiant and graphics engine cannot handle Blender’s quads.

I apply a “material” and a “texture” in Blender and I tend to call them both the same as the jpeg texture file.

To ensure that there are no faces without texture, select all the faces of the object before unwrapping. Individual tris and groups of tris can be adjusted later.

Once you’re happy with the texturing, it’s time to export.

If you have installed the script correctly, it should appear in the File | Export menu.

When you click on it, you get the Export dialog. Navigate to the aatable folder in you Call of Duty 2/model_export folder and click on the aatable.xmodel_export file that you created earlier. Click on the Export button.

That’s it for the Blender part.

Converting the texture into a Call of Duty 2 .iwi file

Open Call of Duty 2 Asset Manager.

Save the file as aatable (the Asset Manager file extension is .gdt)

Click on material in the list box on the left side of the Asset Manager window.

Click on the New Entry button and name the material aatablemat.

Asset Manager now displays a lot of options at the right of the window. We only need to worry about a few.

Starting at the top, change the surface Type from “” to “wood”.

Next, look for the cullFace box in the Framebuffer operations group, and change it from “Back*” which is the default, to “Front”, otherwise the texture is put on the model inside out.

Finally, click on the button beside the Color map box and select the aatablemat.jpg file.

All the other options can be left alone. This is just a basic texture.

Now click on PC Convert in the menu bar and choose Current Asset Only. A black DOS window should pop up and the message at the bottom of the window should read “Conversion done. Hit key to continue…”.

Now for the model.

Converting from .xmodel_export into a Call of Duty 2 xmodel file

Now select xmodel from the list on the left.

Click New Entry and name the model “aatable”.

It’s easiest for me if I name everything similarly, that’s the reason why I use the same name for the model and the Asset Manager .gdt file. I add “mat” for the names of the material and texture in Blender and for the .jpg texture file. This system has worked well for me with COD2 modelling with the xmodel_export script.

 There’s a good reason why I have put “aa” at the beginning of the name of everything in this tutorial: it’s so that the model will appear at the beginning of the list of xmodels in Radiant.

The only section that you need to look at on the right of the Asset Manager window is the filename. Click on the button and select the aatable.xmodel_export file.


Now click on PC Convert in the menu bar and choose Current Asset Only. A black DOS window should pop up and the message at the bottom of the window should read “Conversion done. Hit key to continue…”.

That’s it for Asset Manager. Save the .gdt file and close.

Using the model in Radiant

Now it’s time to put the model into a COD 2 map and see how it looks in-game.

Start Call of Duty 2 Radiant and open a map.

Right-click in the XY Top view and go to misc | model.

The Entity and the Open dialogs open.

The model of the table is the first entry in the xmodel folder in the Open dialog because its name starts with “aa”, so it’s easy to find.

The model in Radiant.

Save and compile the map.

The model in Call of Duty 2.

You may notice that the model is not solid. You need to make a collision map and save it in the collmaps folder.
Any questions? Contact me on www.modsonline.com - my username is flybynyt.
Happy Modding.
flybynyt

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»