- Blender - download. Used to convert 3d models to FBX format. Blender Source Tools - download. Used to load decompiled SFM files into Blender. BoneFix - download. Optional - used to fix skeletons. Crowbar (ZIP Version) - download. Used to decompile SFM files.
- I’m trying to port a model into sfm but as a blender noob, I can’t figure how to remove an ik rig while still being able to move bones. If there is an alternative way to port a model with and ik rig into SFM, please let me know.
This site contains documentation of the various things I have happened to invest some time into investigating and decided to make documentation for
I believe that specific kind of knowledge in the right hands can do a lot of good things, so I decided to document things I know about. The things I know are very niche and I’d be shame if that information would happen to just dissapear one day.
SFM to BLENDER to SFM Editing Sfm Models. Importing Sfm model to Blender Pt.1 Texturing.
I have decided to use 3kliksphilip’s approach to tutorials, based on his old Hammer World Editor tutorial series. Raw simple knowledge that you can kickstart yourself from to do many things. As this knowledge is supposed to create a starting point for you, it is recommended to study more than just the documentation located on this site.
It is highly encouraged to fork and expand on the knowledge and information located on this site.
List of documentation
Linux
Backing up MySQL database on Linux with rclone and Azure Blob Storage
Mounting Onedrive with Rclone mount on startup with Systemd
Changing dynamic or static IP to dynamic or static IP on RHEL based Linux
Network booting CentOS 7 via iPXE and Windows IIS by chainloading iPXE via on-board PXE ROM
Reverse Engineering TP-Link TL-WA901ND firmware and obtaining the filesystem
Migration of RHEL system to a new server (CentOS 7)
Fixing Ubuntu VM on Hyper-V stuck in read-only mode after hot backup or live migration
Booting to Windows remotely on dual-boot CentOS 7 system
Windows
Using Windows applications with the Windows Subsystem for Linux (WSL) Linux filesystem
Using Windows Deployment Services (WDS) with iPXE
Adding AWS Shell to Windows Terminal
Virtualization
Migrating a physical server or a VM from a different hypervisor into a new VM
Connecting to Hyper-V VM console via RDP
Converting a Hyper-V VHD/VHDx to VMWare Workstation VMDK
Using VMWare Workstation VMDK image in ESXi
Networking
Routing all traffic through OpenVPN client on Windows
L2TP with IPSec Point to Point VPN setup on Mikrotik
Deploying pfSense on a system with a single network interface using VLANs on Dell Wyse D90D7 Thin Client
Hardware
World of Warcraft
WoW data extraction resource sheet
Recognizing WoW files with no listfile or extension
Source Engine and Source Filmmaker
Importing Source Engine models into a 3D program
Putting your own model into SFM (very simplified)
Getting the best image quality out of SFM
SFM Depth of Field Post-production
Exporting SFM animations to Blender and 3DS Max, or how to use SFM as an animation tool
3DS Max
Bootstrapping Powershell commands to 3DS Max’s Maxscript to send notifications
Applying Turbosmooth on an already rigged mesh in 3DS Max
Combining multiple skinned meshes into a single mesh while keeping the skinning in 3DS Max
3DS Max and Blender interoperability
3D Applications
Hey everyone, here's a little tutorial on importing Source Filmmaker models into Blender. I get a lot of questions from people who stumble upon a model on SFMLab, download it, and then struggle to import it into Blender or other model tools. So here's a little tutorial to help you all along.
Prerequisites
- A functioning brain
- Beginner computer skills
- Beginner knowledge of Blender
- A modern Windows PC
- The Blender software
Getting started
Download any model you want. I choose this pack of Witcher models. Unzip/rar these files and let's take a look at these files that we just downloaded. Most downloads will contain a folder structure similar to this.
- You have a scripts folder, which contains SFM specific scripts that we don't have any use for right now.
- You have your materials folder, which contains shader instructions and textures.
- You have your models folder, which contains the actual mesh data. For now, we will focus on the mesh itself. We'll get to the textures later.
So let's get in there. Let's see what's in these model folders. First thing you will notice is that a single model is made up of 5 or 3 different files. You can tell from the file name and the extension. There's a whole bunch of technical reasons for that, but for now we're just going to look at the .mdl file. What kind of file is that? Let's open it in Notepad++ and see. Ok, so it's pretty much unreadable. This is because it is a binary file. It was generated by the compiler based on scripts and text files. This isn't a format that's useful to us unless we are using Source Filmmaker.
Decompiling
So the files we have are in a binary format that Blender doesn't understand. What we want is the original files that the artist used to compile these models. The problem there is that the artist may not always provide those publicly. That's why we have to reverse the work the compiler did. This is what we call decompiling. The process of decompiling is never 100% accurate. It should be seen as a 'best effort'. Some parts of models may not get decompiled properly, but results are usually pretty good.
If you have any issues with the decompiler, make sure to read the message output, as it will usually tell you if you did something wrong. If the decompiler fails to properly decompile your model, visit the Crowbar Steam community or their Discord server for help.
So for this, we are going to download Crowbar. It is a decompiling tool for the Source Engine and a whole bunch more. Just download it from their Steam Community page, unzip it and run Crowbar.exe.
There are several decompilers for the Source Engine model format. However, most of them are outdated and only work with models compiled for older generations of the Source engine. At time of writing, Crowbar is the only one that works with the more recent versions of the Source engine.
So with Crowbar open, go to decompile tab. There are a lot of buttons and settings here, but we're pretty much fine with the default settings. The only thing we need to do is select the MDL file or folder. I'm just going to select the main folder of the model pack I downloaded as it's only about 6 or 7 models. The Output folder is set to be a subfolder of the .MDL file location, which is fine for me, but you can adjust this if you want. Hit decompile, and see what it does.
If you downloaded a big pack of models, it's usually better to select the .MDL file directly instead of converting the entire folder. It's also advisable to not run this in your Source Filmmaker usermod
directory.
Ok, so it seems to be done processing the models. Let's look in the model directory to see what it's generated.
Looking at the generated files.
The model now consists of several other files. You should see the following:
- One or several .SMD files.
These contain the skeleton, animations and mesh geometry of (parts) of your model. If you were to open one of these with a text editor, you would see a structured list of bone names, followed by a lot of different numeric values. This is the model skeleton and mesh geometry.
- One .VTA file.
This one is only present if the model has face flexes, and therefore it is optional. If you were to open one of these with a text editor, you would see a a file structure similar to the .SMD file, but it will contain vertex animation data which is also represented by many numeric values.
- A .QC file.
This is the script that the compiler would use to combine the .SMD and .VTA files into the compiled model. If you were to open this file with a text editor, you would see several values describing the model's name, which SMD files to use for which bodygroups, as well as material locations and any animations.
Importing these files into Blender
For this tutorial we will use Blender, but there are SMD importers for Maya and 3ds Max as well. They don't work quite the same, but the same concepts apply. If you can't figure out the 3ds Max or Maya importers on your own, you can always follow along with this tutorial and export the files out of Blender as FBX or Collada/DAE.
Structured text files! This is a format we can use with a simple importer. Assuming you have already downloaded and installed Blender, you can go ahead and download the Blender Source Tools. Don't unzip this file. In Blender, Select File > User Preferences. Go to the Addons tab. Click Install From File... in the bottom of the window. Find the downloaded zip file. Find and check the Source Tools' box. Wait a moment for activation to complete. Click Save User Settings. The plugin should now be installed.
Go to File -> Import -> Source Engine. Now, navigate to the directory where you decompiled your models, and select the .QC file you want to import. The importer will read the QC file and try to import all the SMD files automatically. It will also read flex definitions and the VTA file and attempt to match those to the SMD files. This last part doesn't always work, but it does a good job most of the time.
Import Sfm To Blender
If everything went well, you should now have your model in Blender! Hurray! From here on, you can edit, animate and render the model as you would like. You can also export the model in a different format like DAE or FBX if you want to use a different tool. The only thing that's missing is the textures.
Textures
So now we finally get to dive into the materials folder. In here, you will find .VMT files and VTF files. VMT files are just text files that define which textures the shader should load in the Source engine. The VTF files are the actual textures. However, Blender doesn't read VTF textures. We need to convert them, and for that we need VTFEdit.
Sfm To Blender Addon
Once you have VTFEdit open, go to Tools -> Convert Folder. This will open up the Batch convert window. First select your Input folder. Set this to the folder that contains the VTF files, or simply the materials directory of the zip you downloaded. Set the output folder to where you want the converted files to be. This can also be the same folder. Next, if the radial toggle is set to 'To VTF', change it to 'To tga'.
You can also pick 'To PNG', but in my experience, Blender and Photoshop work better with TGA for textures. This is because VTF files will often have an ALPHA channel which controls the transparency. TGA files will keep this data as a separate channel, while PNG files will bake the transparency data onto each RGB color channel, making it more difficult to separate and use this data effectively.
Lastly, tick 'Recursive' and untick 'Make VMT files'. Finally, hit Convert. Look at the message window below to see what it's doing. Depending on the number and size of the textures, this should be finished rather quickly.
Once the converting done, you have all the TGA files and can start assigning them in Blender. For this part of the process I'm going to assume you have some basic knowledge related to setting up materials in Blender. You can make the shaders as crazy as you want. Sometimes people aren't sure which textures belong to a specific material, so here's some pointers for that. Remember the VMT files? Basically each Material in Blender points to a VMT file with the same name. If you open that VMT file in a text editor, you can see several Source Engine material parameters like $basetexture
and $bumpmap
. These point to VTF files. Based on those filenames, you can match up textures to the right material. It's that simple.
Conclusion
You now know how to decompile Source engine models, import them into Blender and convert their textures. I hope you found this tutorial useful.
Links
- Blender - Blender.org
- Witcher Blood and Wine models - https://sfmlab.com/item/1424/
- Crowbar - https://steamcommunity.com/groups/CrowbarTool
- Blender Source tools - http://steamreview.org/BlenderSourceTools/
- VTFEdit - http://nemesis.thewavelength.net/index.php?p=41
Comments are closed.