Firstly you’ll need to download GUIStudioMDL, which you can get here:
We’ll be using this later!
Ok, so your model is skinned and looking yummy! Now we need to export it so we can compile it for use in Hammer and your mod!
Go back to XSI and select your cube. Go to the Transform menu and select “Freeze all Transforms”. This is important. If you don’t do this each time you change your model from now on, it will go horribly wrong. So remember, if you decide to scale your model or change it, Freeze all Transforms before exporting.
Now, right at the bottom of the screen, on the left hand side is a textbox with “1″ inside. Change this to “0″. Also important!
Next… Go to the ValveSource menu at the top and click Export SMD. Click the three dots on the right hand side to browse your harddisk. Go to the following directory:
1 | SteamApps/username/sourcesdk_content/hl2mp/model_src/ |
Then name your file “cube” and click “OK”. You will be back onto the original screen now. So to start with we need to export the actual model. So make sure “File Type” is set to “Model .smd”. Lastly, uncheck “Remove all unused bones (use on character rig only)”. Now click “OK”.
You’re not done yet! Again, go to the ValveSource Menu and click Export SMD. This time change “File Type” to “Physbox .smd”. Next change the name of your file to “cube_phys.smd”. Click OK.
Last one! Do it again, and change “File Type” to “Skeletel Animation .smd”. Change the filename to “cube_idle.smd”.
Good! You’ve exported your model!
Now you need to create a QC File! Go to the directory where you save your SMD files.
1 | SteamApps/username/sourcesdk_content/hl2mp/model_src/ |
Open up notepad and paste the following code inside:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | // Output .MDL $modelname cube/cube.mdl // Directory of materials that the model uses $cdmaterials models/cube //Defines model and static of physics //$static // Material properties $surfaceprop "metal" // Scale all units by a factor of 40 $scale 40.0 // Base or Reference .SMD $body studio "./cube" // sequences: all sequences are in $cd $sequence idle "cube_idle" loop fps 15 // Physics data $collisionmodel "cube_phys.smd" { $Mass 5 $concave} |
Save your file as “cube.qc” in the same way as before to create this file as a .qc file. Make sure it’s in the same directory as your SMD files.
Now open up GUIStudioMDL. Change the “Target Mod or Gamepath Info” dropdown box to Half-Life 2 DeathMatch. Then click Load QC from the File menu. Browse to the directory above and load your “cube.qc” file. Then click “Compile”.
Once it’s finished your model is ready to use in Hammer… but first, you need to put the VTF and VMT files in the right directory.
In the QC file we told the model to look for the skin in the directory “models/cube”. Copy your VTF and VMT file and browse to the following directory:
1 | SteamApps/username/half-life 2 deathmatch/hl2mp/materials/models/ |
Create the directory “cube” inside this folder, and place both your VTF and VMT in here.
Now load up Hammer! Once loaded, create a prop_physics multiplayer entity and press ALT-ENTER to view the KeyValues. Select World Model and browse for your model… Type “Cube” to filter it out. If all has gone well, you should see your skinned model in the model browser! Just click OK to place it in your map!
At this point, you might discover your model is WAAAY too big. Don’t panic. Just open up your QC File again and change this line:
1 | $scale 40.0 |
To a smaller number, relative to the size it appears in Hammer. Then recompile it using GUIStudioMDL… Once you’ve got it to the right size. Compile your map and chuck your cube about!














