Source Filmmaker

Source Filmmaker

35 ratings
Converting XNA Model Files to Work in SFM Using Blender
By Pte Jack
This is a video series demonstrating the process of converting XNA Model files into Valve Model Files and Materials for use in SFM.

It is a lengthy process, but learning this process will help you bring more custom content into your model inventory.

We will be using a variety of different programs during this process, these are XNALara, Blender, Gimp, VTFEdit, Notepad ++ and GUIStudioMDL. Part 1 of the Series shows you where to get these programs and Part 2 will show you how to install them. As we use the programs you will see further steps required to configure them.

It is beyond the scope of this guide to give DETAILED instruction in the use of Blender, XNALara, GIMP, or any of the other programs used here beyond what you see in the videos. For that kind of instruction visit the numerous tutorial websites out there that specialize in the program you want to learn.

I used this process to convert the BioShock Infinite Songbird seen in the workshop and depicted in the Title picture here. By the end of the series you will have converted an XNA model into a working SFM Model and the last video of the series will even show you how to upload your conversion to the SFM Workshop.

The beauty of this process is that the Blender and the compile portion is pretty much the same if you decide to create your own 3D content. The only thing that is different, is that you have to create your materials (with a GIMP or a 3D-Coat type program) before you can skin your model.

Anyway, without further ado...

We're GOin' a Wreck It....
Pt. 1 - Introduction and Getting the Required Programs

The Programs required to perform this process are as follow:

1. XNALara Poser
This is a poser program used to create 3d art. It also has the ability to export XNA models into .mesh.ascii text files or .obj type model files. The prefered export is the .mesh.ascii type file. This type of file contains most (if not all) the model information, including skeletal and texture information, required by Blender to make conversion easier. The .OBJ model will only contain rough mesh and minimal texture information and does not include the model skeleton.
Available at

2. Microsoft XNA Framework Redistributable 3.0
This is the background program that XNALara requires to run in Windows. If this is not loaded on your computer, XNALara will not start.
Available at

3. Blender
This is a powerful and free 3D editing tool. (This series assumes you have a basic knowledge of Blender. If you don't, I would suggest you go to and watch the Begginner's tutorials, especially the tutorial on Basic Interface. ( Although this particular tutorial talks about Blender ver 2.5 the interfaces have not change too much to todays (v2.68) interfaces.
Available at

4. Blender 2.63 importer by Dusan, sephirostoy, XNAaraL and FigureSculptor
This is a Blender Plug-in that allows the ability to import the .mesh.ascii models exported by XNALara. Without this plug-in you will not be able to take advantage of the detailed information contained in the .mesh.ascii file.
Available at

5. Blender SMD Script
This is another Blender Plug-In required for the ability to import and export the Valve Model Source files reuired to build the model for SFM. This tool allows modelers to export in both .SMD and .DMX formats
Available at

This is is an extremely powerful and free Image Manipulator Tool. It is almost if not par with Photoshop (when you learn to use it effectively)
Available at

7. GIMP VTF Plugin
This is an extremely useful Plug-In for GIMP that allows you to convert almost any image file to the VTF Texture format required by Valve Models.
Available at

8. VTFEdit v.1.3.3
This tool is also used to convert images to and from VTF format. BUT, it also is an extremely useful tool for auto-generating simple .VMT files required by the Valve Model Material files.
Available at

A very powerful and effective pure text editing tool. (I prefer this one because of the programmer interfaces and plug-ins available.)
Available at

10. GUIStudioMDL
This is a graphic user interface program used to send commands to the Valve StudioMDL compiler. It is a useful tool when correctly set up. You can use the Valve StudioMDL tool directly, however it required that a batch file be written to send the proper commands. This tool does that chore and interfaces with the Valve program from a Windowed Environment.
Available at
Pt. 2 - Installation of the Programs Downloaded in Pt1
In this Video we install the programs that we downloaded in Part 1. XNALara requires a Windows Feature to be activated and a framework shell be installed in order for it to work. Blender requires 2 plug-ins and Gimp requires 1 plug-in installed. Here's the breakdown of the actual install process:

1. XNALara and Blender contents are designed to run from anywhere on your computer, the main folder can be dragged straight on to your desktop from their zip files or you can tuck Blender into your Program Files Folder (if you downloaded the 64bit version) I would stick XNALara in your Program Files (x86) folder if you want to tuck it away.)

2. Gimp, VTFEdit, Notepad++ and the Microsoft XNA Framework programs all have installers, just double click and follow the install instructions.

3. GUIStudioMDL, open the zip file and extract the GUIStudioMDL.exe to your Steam\Steamapps\username\sdktools\bin\ep1\bin folder

4. The plug-in file goes into your blender\2.68\scripts\addons folder

5. Open the and drag the io_scene_valvesource folder and the file into the same blender\2.68\scripts\addons folder

6. Open the then use a file browers to find your GIMP install folder. Drag the file-vtf.exe and the VTFLib.dll files from the zip file to your GIMP 2\lib\gimp\2.0\plug-ins folder.

7. Open your Control Panel and goto Programs and Features, Click on Turn Windows Features on or off, Find .NET Framework 3.5 (includes .NET 2.0 and .Net 3.0) and ensure that the feature is turne on. (Required for XNALara)

8. After the install, it is always good to re-boot your computer, especially if you had to turn on the .NET Framework

Pt 3 - XNALara - A 3D Model Posing Program and Required for Exporting XNA Models
In this video we look at what the XNALara Poser program is, what it can be used for and how to export model data into a format that can be imported into Blender for editing. We also look at a new resource for possible model content for SFM, the XNALara forum at Deviantart.


Export Process for XNA models to .mesh.ascii format which is readable by Blender if the proper plug-ins are installed.

1. Download the applicable XNA model from wherever.
2. Extract the model folder (including materials) to the XNALara Data folder.
3. Load XNALara
4. If XNALara displays an error message and crashes, go to the XNALara main folder and delete the XNA.cfg file then re-launch XNALara. (It should load)
5. Select File, then Add Model(s) in the Control Window, then select the model you want to load, click OK.
6. View the model in the Pose Window to ensure it is the model you want.
7. At this point you can pose the model, or just leave it as is.
8. To Export the model to work in Blender, if you hve more than one model loaded in XNALara, ensure you have the model you want displayed in the Model: text box. Select File, then use the export as method of choice.
1. Export scene as .obj - no skeletal info and limited texture info will be exported
2. Export selected as .mesh.ascii (T-Pose) - This is the preferred method This should export all the model info required by Blender to include skeletal Vertex group and texture information.
3. Export selected as .mesh.ascii (Posed) - Same as above, but if you posed the character in XNALara, that pose position will be exported to the .mesh.ascii file and should load in Blender that way.

Once the export is complete, you can close XNALara. It is no longer required.

If you wish to find out more about the XNALara Poser tool, Check out the #XNALara group at Deviant Art.

3D Model Resource Warning:
This is an artists' website which caters to all types of artistic flavours. The site does contain mature content which may include nudity and sexually explicit content, therefore user descression is advised!!!

Deviant Art XNALara Gallery:
Pt 4 - Blender - A Free Open Source 3D Editing Program (and much more!!)
This video discusses the set up of the required plug ins for Blender. I also give you a really good source for beginner tutorials. A website called Blendtuts. If you have never used, or are just starting to use Blender for the first time, I suggest you go to this site and watch the Basic Interfaces video there. It will explain the fundimental set up and basic keys needed to manouver in the Blender world.

Tutorial Resource

Pt 5 through Pt 11 - Using Blender
It is hard to give a step by step proceure for these videos. This is where we import the mesh.ascii file and begin the Blender process of removing duplicate vertexes, working the armature (bone/skeleton) settings, rename Bones so they fall into known bone groups in SFM, fixing any broken meshes, assigning vertex groups to make linking the armature easier, skin and name textures and materials and make UV maps so the SMDs know what materials to call for the model in SFM, rescale the model so it is the scale you want it to be in SFM and export the SMD files required for compiling.

Pt 5 - Blender - Looking at and Identifing the Imported Model


Pt 6 - Working the Armature (skeleton) AKA "Dem Bones"


Pt 7 - Materials and Texturing the Model - Ensuring that the Materials are properly named


Pt 8 - He's Not Normal - Discussing the Normals Direction of the Mesh Faces and Applying Light to see What the Model will Look Like.


Pt 9 - Scaling the Model - Is your Model really as BIG as You Think IT is??


Pt 10 - More on Scaling and Bone Naming Conventions - Getting rid of those UNKNOWN Bone Groups


Pt 11 - Creating the Idle Sequence - Required for Posable Characters and Exporting the SMD

This segment shows you how to set up the required Idle Sequence for nonStatic models. It also goes through the SDM Plug-in settings and the export process to export your smd files.

Pt 12 - The GIMP (General Image Manipulation Program) - A Free Graphics Editor
We use The GIMP Image Manipulator Program and it's VTF Plug-in to convert the skin's TGA image files to Valve Texture Files (VTF). model.

Pt 13 - VTFEdit - Used to create the VMTs for Our Material Files
We use VTFEdit to create the basic VMT files that call the skins to the model using the GUI VMT creation tool in the program.

Pt 14 - Creating the file that Pulls it All Together, a Basic .qc and Using the GUIStudioMDL Compiler Interface
We create a very simple .qc file which is used by the Valve StudioMDL program to compile the model. As this is a multi-part model, you get some limited experience calling the various parts that build the model.

We then set up the Graphic User Interface program that assists us with getting the .qc to StudioMDL. This program is called GUIStudioMDL. We first have to configure the tool, then we have to inform it about the GameInfo.txt file for SFM. This will allow us to use the correct version of the Valve StudioMDL Compiler so the model will load into SFM correctly.

We finish this part by bringing our newly compiled model into SFM.

Your finished .qc file should look something like this:

Your end qc should look like this

$cd "C:\{change this to the folder path where you put your smd files}\ralph"
$modelname "ralph/ralph.mdl"
$model "body" "body.smd"
$model "body" "eyes.smd"
$model "body" "hair.smd"
$model "body" "head.smd"
$poseparameter body_pitch -45.00 45.00
$poseparameter body_yaw -45.00 45.00
$cdmaterials "models\ralph"
// Model uses material materials\models\ralph\body.vmt
// Model uses material materials\models\ralph\hair.vmt
// Model uses material materials\models\ralph\eyes.vmt
$surfaceprop "flesh"
$illumposition 0.000 1.680 40.090
$sequence idle "idle" fps 30.00

Pt 15 - The Conclusion - Uploading Your Newly Compiled Model to the SFM Workshop
In this part, I show you that properly named bones will appear in the known bone groups in SFM, then take you through the step of uploading your model to the SFM Workshop.


And there you have it..

< >
the swift gamer Jul 17, 2016 @ 11:37pm 
Huge problem with mine...the textures was missing,the bones were really bad, and the model was super tiny. About the size of ralphs big joke.

햇빛 Jul 2, 2016 @ 12:55pm 
Lord this is going to be a long night

Got to get reading
Pte Jack  [author] Dec 24, 2015 @ 3:56pm 
Have not done one, you might check the GMod Hub.
mrbenio Dec 24, 2015 @ 3:44pm 
Drat, I'm looking at the wrong one; where a guide on how to convert XNALara models to Garry's Mod?
Pte Jack  [author] Oct 1, 2015 @ 6:16pm 
All I can say is welcome to the world of modeling for 3d applications... It's as hard as you make it. Once you do things a few times, you start finding shortcuts and because it's repetitive, things become easier.
OpHsVinicius Oct 1, 2015 @ 5:10pm 

very simple mode? please..?
I hate video games. Apr 28, 2015 @ 11:47am 
You may be right. The most number of verts I've packed into a single object is 10,000 so I never encountered a problem.
Pte Jack  [author] Apr 27, 2015 @ 6:31pm 
You have to be careful with that. Studiomdl has a limit to how many verts can be in a object before it starts splitting the object into separate model. I think the limit is somewhere around 12,000 to 15,000 verts. If Studiomdl starts splitting the model, then some things make break, especially flex controls.
I hate video games. Apr 27, 2015 @ 2:36pm 
Just want to add a tip that if you want your model to be exported as a single .SMD in Blender, put all the meshes that you want to be grouped into one SMD into a Group in the Object panel. Grouping doesn't affect the individual meshes in any way except it makes the Source tool able to export the "grouped" meshes as one big SMD.
1,1,2,3,5,8,13,21,34,55,89,144 Apr 18, 2015 @ 8:00am 
I'm surprised I missed that. Thanks.