Modifying a Source Model in Maya
In this tutorial, we will go step-by-step through the process of getting Dr. Kleiner into Maya.
What You Need
Maya PLE - A free version of Maya.
MDLDecompiler - To turn compiled MDL files back into SMD format.
First we'll decompile the model. For this we'll use MDLDecompiler which, once you've downloaded it, should be in your ...\SteamApps\<account name>\sourcesdk\bin folder. When you launch mdldecompiler.exe, make sure that Steam is running and that "Use Steam File Access" is checked. Click the ellipsis button next to the "Choose Model File" field and locate the Kleiner model (see Fig 1).
If you have trouble accessing the GCF file, use GCFScape to extract Kleiner.dx80.vtx, Kleiner.dx90.vtx, Kleiner.mdl, Kleiner.phy, Kleiner.sw.vtx and Kleiner.vvd from
source models.gcf (see Fig 2). Then uncheck "Use Steam File Access" in MDLDecompiler and locate the extracted Kleiner.mdl file for the "Choose Model File" field.
When you have the model file selected, you can extract it to a directory (see Fig 3). For this tutorial, I will use D:\test\.
Now we need to extract the textures in TGA format. Using VTF Explorer, navigate to
source materials.gcf\hl2\materials\Models\Kleiner. Select the first texture and choose File > Save As > Targa (*.tga) (see Fig 4). Repeat this step for each of the eleven textures (unfortunately, there is no way to export them all at once). You may save them wherever you like, but for ease I will put them in D:\test\.
Great! Now that everything is extracted, we can begin importing into Maya.
Importing into Maya
The Source SDK comes with scripts that allow Maya to import and export SMD files. In order to use them, we must put them in the correct Maya scripts folder. So, copy the contents of the
...\SteamApps\<account name>\sourcesdk\maya\4.5\scripts\ to the
\maya\7.0PLE\scripts\ folder in My Documents. Now we need to tweak two of the script files to avoid version compatibility problems. Go into
\maya\7.0PLE\scripts\smd (the folder you just pasted), select both smdRead.mel and smdMakeShader.mel, right-click, select properties, and uncheck "Read-only." Now open smdMakeShader.mel with Notepad and change the line
connectAttr -f ($place + ".mirror") ($fileTex + ".mirror");
//connectAttr -f ($place + ".mirror") ($fileTex + ".mirror");
Save and close. Now open smdRead.mel with Notepad and change the line
print `system "time"`;
//print `system "time"`;
Save and close. Now open Maya. From the file menu, choose Import SMD... and locate the file kleiner_reference.smd from among the many that were decompiled (see Fig 5). Maya will then prompt you to find "mouth." It is looking for the mouth texture we extracted earlier. Navigate to the textures (if you follow my directory nomenclature, they will be in D:\test\) and select mouth.tga and press Find. Maya will then import the model. THIS WILL TAKE A LONG TIME! My machine takes about 9 minuets and 25 seconds to complete this operation, and I have a pretty nice system. While you wait, Maya will appear to be unresponsive. Just give it time. When the ordeal is over, the model should come in sideways and you will be presented with an orientation prompt (see Fig 6). The model thinks Z is up but Maya, by default, thinks Y is up. You can choose to change one or the other. I choose the left-most button: "Model > Y-up."
Now press 6 to enter ShadedAndTextured mode. Looking at the model, you will notice some odd spike (see Fig 7). This is an issue with skin weights. It is easily resolved. Select the polymesh (click anywhere on the model) and press Ctrl+A to open the Attribute Editor. Go to the skinCluster1 tab in the attribute editor and click the "Update Weights" button (see Fig 8).
You now have a properly textured and rigged model in Maya ready for re-skinning, animation, and other editing!