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

Members Online

»
0 Active | 93 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
Importing Custom Models from Maya
Versions: You must be logged in to view history.

In this tutorial, I'm going to explain how to bring a model from scratch into Call of Duty 2 using the model exporter tool supplied by IW & Activision. This is a step by step process which assumes some familiarity with Maya 6.0 and basic modeling/UV mapping/texturing.

CoD2 Maya model export tutorial

by: Tim Lobes - www.timlobes.net



Prerequisites:

Software - Call of Duty 2 PC retail, 1.3 patch, CoD2 Mod Tools, Photoshop/Gimp, Maya 6.0 Complete or Unlimited (must not be a beta/CG version)
Skills - Simple Maya modeling skills, how to UV and texture a model

Needed files:
http://www.iwnation.com/Forums/index.php?act=Attach&type=post&id=3598



Section I - Setup

1) Go to My Documents/maya/6.0/

- Create a new text document called Maya.env

Containing the following two lines:


Code:
MAYA_PLUG_IN_PATH = E:\Program Files\Activision\Call of Duty 2\bin\maya
MAYA_SCRIPT_PATH = E:\Program Files\Activision\Call of Duty 2\bin\maya



Replace E with the correct drive letter Call of Duty 2 is installed to. Save and close.


2) Look in your /My Documents/maya/6.0/scripts/ directory for the file usersetup.mel. If it is NOT there, copy /Call of Duty 2/bin/maya/scripts/usersetup.mel to /My Documents/maya/6.0/scripts/.

If it IS there, open the Call of Duty 2 version of the file in a text editor, copy it all, open up the existing maya version of the file, and paste it to the end. Save and close.


3) Rename the CODExportModelWindow.Mel to CODExportModelWindow.Mel.bak in your \Call of Duty 2\bin\maya\ directory. Download the .zip from the url in the prereq section and extract that file to this directory. This fixes a bug that relied on a file check-in program called Perforce to be used with the exporter. Most end users don't have this program, so a workaround was made.


4) Open up Maya 6.0. At the top of your menu you will see a new menu item "COD Tools" to the left of Help. If it's not there, you messed up :( Click on the 3 options it gives you to make sure they open. You may have to resize the window that pops up to get all the info.



Section II - Modeling

1) In /Call of Duty 2/ folder, create /models and /modelskins folders.


2) With Maya open, make a new scene. I made a box :D. You can do more if you want. Ensure the following things:

  1. All the pieces of your model should be combined into one after you are done. (Edit->Select all Polygons->Combine)
  2. Create a new lambert/blinn/phong material (doesn't matter) and rename it to mtl_mybox. Do not use or modify the already made lambert1 material.
  3. Create a UV map
  4. The model should be centered at the origin and rotated +90 degrees around the X axis.*
  5. The pivot of your model should generally be set at floor level.**
  6. Ensure the scale is correct. It's around 6-8 maya units a foot inside Call of Duty 2. You can always come back and rescale the model.
  7. In the Maya outliner, rename the model to mybox.




*In Maya, the Y axis is up/down. In CoD, the Z axis is up/down. To fix this on your model, you can either change the preferences in Maya... or... rotate the model in the X axis positive 90 degrees.

**This can always be tweaked in Radiant. If you have multi-piece model (such as a windmill which has a base and it's blades), the blades' pivot should be set at where the base would connect to it. Again, it can be changed within Radiant, but this method ensures precision.


3) Save your model as mybox.mb in the /Call of Duty 2/models/ folder.


4) Once you've made a texture, save it as mtl_mybox.jpg in the /Call of Duty 2/modelskins/ folder.


5) Assign the color node of mtl_mybox (under Common Material Attributes) to a file that points to mtl_mybox.jpg (located in your /modelskins/ folder). Ensure the texture is looks right on your model.


6) Freeze transformations (Select the model. Modify->Freeze Transformations). This is optional, but recommended if you are done tweaking the model.


7) Delete History (Select your model, Edit->Delete by Type->History). This is optional, but again, recommended.


8) Save.



Section III - Exporting

1) Click on COD Tools->Model Exporter

2) Select your model and click Add new entry. Click the ... button and browse to the /Call of Duty 2/model_export/ folder. Type in mybox and click Set.

3) Check the Entry1 box, ensure your model is still selected, and click on Export Selected Entries and click yes.

4) You may close Maya. Go to the /Call of Duty 2/model_export/ folder. If you see mybox.XMODEL_EXPORT, it worked!



Section IV - Asset Manager

1) Open up your asset manager.

2) Scroll down and select material, type in mtl_mybox in name: and click New Entry and hit ok.

3) Select a surfaceType that you want for your box. Leave materialType as world phong.

4) Click the ... box under color map and browse to the mtl_mybox.jpg texture under /modelskins/. As you can see, you can also add normal, detail, spec, and cosine power maps.

5) Go to File->Save. Save as mtl_mybox.gdt in /model_export/

6) File->New. Scroll down and select xmodel, type in mybox in name: and click New Entry and hit ok.

7) Under filename, hit the ... box and browse to your mybox.XMODEL_EXPORT in the /model_export/ folder.

8) Go to File->Save. Save as mybox.gdt in /model_export/

9) File->Open mtl_mybox.gdt. Click on mtl_mybox under the entry type list and hit F10 (PC Convert->Current Asset Only)

10) File-Open mybox.gdt. Click on mybox under the entry type list and hit F10 again.

11) If all is well and no errors popped up, open up Radiant, create a misc_model and mybox should appear. It should appear textured and will show up in game.



Section V - Clipping Map

You will notice that even though we defined a material type for mybox, it still isn't being clipped.

1) Open up a new map in Radiant. Place a misc_model and set it to mybox. Center the origin of the misc_model (blue box) to the origin of the map (0,0,0).

2) Create clip brushes around your model to where you want specific things to clip. Right now your model is a ghost. It can be seen but not touched. Ensure the clip brushes match up how you want it. You may mix and match as you please (player, metal, ai, etc)

3) Delete the misc_model so only the clip brushes remain. Nothing else should exist in the .map besides the clipping brushes. No other settings should have been changed.

4) Save the map as mybox.map inside the /Call of Duty 2/collmaps/ folder.


You model is now ready to be used inside Call of Duty 2!


When you release your map, make sure to include collmaps/, main/images/, main/xmodel/, main/xmodelparts, and main/xmodelsurfs in your .iwd file.



Other Thoughts

I know it's hard to find Maya 6.0 nowadays and it's a shame a plugin still hasn't been made available to the public that allows exporting on all version of Maya since 6.0. I'm an artist far more than I am a programmer, but after doing a bit of tinkering, it's very possible to make a new plugin without the need for IW to release the source code.

What the current plugin does is take the ascii version of the maya file, triangulate the faces, get rid of the useless information concerning the Maya HUD preferences, and feed in the vertices, faces, material nodes, and other tidbits of information that define the model. It then spits it out into another ascii format, the XMODEL_EXPORT, that the asset manager can read. It's like a dishwasher, put in dirty dishes and they come out clean. They are always dishes, that won't change.

What a programmer out there needs to do is take a look at a couple of different XMODEL_EXPORT files to see how IW has it setup and create a little utility, doesn't even need Maya, to read maya ascii files (so any version can be used), and organize them into IW's template for the export. This utility could even have options to delete history and freeze transformations for you (which IW's plugin probably already does) as well as other helpful things, such as scaling from the pivot or assigning a new texture path without having to open Maya.

** The full HTML version of this including pics will be available on my site. No BBCode :)

 

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

»