Level Design

Export Guide for Maya to Source

Somebody else made this tutorial. Therefore I, Lorence, will not take credit of this document. If there’s any kind of confusion, or materials that you may not understand in this tutorial come to me for any questions. I will try my to give you the best answer possible and if I can’t….. go f*** yourself.


So you want to import your cool new model that you made in Maya into the maddening source engine. Well hopefully by following the steps in this guide you will be able to view your model in the hl2 model viewer to make sure that everything is going according to plan.

What You Need:
 Maya 7+
 Prall SMD exporter
 Steam

Installing the Prall Exporter: To install the Prall exporter you need to put the files found in the Prall plug-in folder into the plug-in folder found in your Maya plug-in folder. Also, copy the files from the Prall shelf folder to the Maya shelf folder. Now start up Maya and you should see a new hl2 export shelf with the buttons that you need.

Setting Up Your Scene: Create a folder in your modlesrc folder and label it the same as your scene file. This is where you will save your scene and your exported .smd files. Also, save your .tga texture file into the materialsrc folder in your mod folder.

Setting Up Your Model: In order for the Prall exporter to work, you will need to do a few things to your model.

• Combine all geometry into one mesh
• Delete history
• Snap pivot point to the bottom middle of your model
• Center pivot at (0,0)
• Freeze transformations
• Apply color texture to model using the .tga that you saved in the materials folder

Once you have done these steps your model is ready for export.

Setting Up Your Collision Mesh: The collision mesh is set up similar to how you set up your model but there are a few differences.

• Keep all of your geometry in separate pieces
• Delete history
• Freeze transformations

Setting Up Your Layers: When using the Prall exporter, the exporter needs two different layers to look in when it exports.

• Create a layer and name it “reference” Place your model into this layer
• Create a layer and name it “physics” Place your collision meshes into this layer

Now you need to move the shape node of your model and collision meshes under these respective layers as well.

• Open window, relationship editors, display layers
• Find the reference layer on the left and select it
• Find the name of your model on the right and expand it to see its shape node, select the shape node
• You will now see both the model and its shape node under the reference layer

• Repeat these steps for the physics layer and every collision mesh

Using the Prall Exporter: Now that you have your models set up you are now able to use the Prall exporter to export your model.

 On the hl2 Export shelf is a button labeled “Export,” click this button
 On the first screen that comes up select the check boxes so that it looks like this:

 Next click the path settings tab and hit the default button. This will set the paths for exporting to the folder that you saved your scene file into earlier. On the texture line replace the default from where it says /modelsrc/folder name/scene name with just /materialsrc. This will make sure that when you export it will know where the texture is coming from.
 Now click full compile down at the bottom and it will export three .smd files for you.

As far as compiling it. It gets a little more complicated and confusing. I will do it in class for the people that want to learn it. Ie: environment artists

+ Compiling Guide for Source


Now that you have successfully exported your .smd files from Maya you will need to compile these files together to create the .mdl. This is the model file that Source reads.

Setting Up Your .qc File: Right now open the folder og the model that you are working on in the modelsrc folder. It should look something like this minus the .bat file and the .qc file:

The .qc file is where you can set up some parameters and settings for your model so that when it is compiled into the .mdl file, it will have certain characteristics. For beginners, here is what your .qc file will look like:

$modelname fileName\fileName.mdl
$cdmaterials models\fileName

$scale 1
$upaxis Y

$body studio "fileName.smd"
$sequence idle "fileName_idle" fps 30 activity ACT_idle 1

$surfaceprop "rock"

$collisionmodel "fileName_phy.smd"
$Mass 1

 To create a .qc file you need to first turn off “hide extensions for known file types.” To turn this off, open a folder, click tools, folder options. In here click the view tab and scroll down till you see “hide extensions for known file types” and un-check the box.
 Now create a new text file. Rename it fileName.qc
 Click to open the newly created .qc file and tell windows to open it with notepad
 Copy the text from above into your .qc file but make sure to enter in the correct fileName
 Save and close the file

Setting Up your .bat File: Now that you have the .qc file created you need to set up and automated .bat file that will compile your model for you.

 Create a new text file and rename it fileName.bat
 If you click on the file now it will run so to edit it you will need to right click and click edit
 In here you need to paste the directory path to your studiomdl.exe file and the path to your fileName.qc file.
 The studiomdl.exe file will be found in Steam/steamapps/userName/sourcessdk/bin/studiomdl.exe
 Your fileName.qc file is found in modName/modelsrc/fileName/fileName.qc
 Paste both of these paths into your fileName.bat file with quotaions around them.
 After the path type pause so that when the fileName.bat is done running it won't automatically close.
 Your fileName.bat file should look like this:

Converting Your .tga and Setting Up Your .vmt file: In order for Source to be able to read your texture file you will need to convert it to a .vtf.

 You need to find the vtex.exe in Steam/steamapps/userName/sourcesdk/bin/vtex.exe
 All you need to do is drag your fileName.tga onto the vtex.exe and it will convert your file for you and place it into the Steam/steamapps/usermods/modName/materials folder.

Now you need to create a .vmt file for your texture. This is the material file where Source will look to apply to your model.

 Browse to Steam/steamapps/usermods/modName/materials/models. If there is no models folder create one.
 In the models folder create a folder with the same name as your model
 Create a new text file and name it fileName.vmt and open it with notepad.
 Here is a basic .vmt file:

"$basetexture" "fileName"
"model" 1
"$envmapmode" 1


 Copy this into your fileName.vmt file and add the correct file name.
 Close and save

Compiling Your Model: Now that you have everything set up, you are now able to compile your .mdl.

 Browse to your fileName.bat file that you created before.
 Run the fileName.bat
 After it has finished your .mdl will show up in Steam/steamapps/usermods/modName/models/fileName
 Browse to Steam/steamapps/userName/sourcesdk/bin/hl2mv.exe
 Drag your fileName.mdl file onto the hl2mv.exe and your model will show up with its texture
 Use the left mouse to rotate and the right mouse to zoom.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License