Source SDK

Source SDK

Not enough ratings
Changing Source Tools Settings
By мяFunreal
The Blender Source Tools are awesome, but they have some default settings that just won't do.
Some of them literally trip up beginners, all the time. Learn how to change these things here.
   
Award
Favorite
Favorited
Unfavorite
Foreword
Blender Source Tools is invaluable, but it has its problems.
After having spent multiple years helping people with making mods, I've noticed a lot of people getting tripped up by issues that could have been avoided if the default settings for blender source tools would have been different.

This guide aims to fix and change some default settings to make the tool easier to use.
It's annoying that you got to do that yourself, but it is what it is.

For example, the collection system clutters the "outliner" and also causes people to not notice their model isn't parented to the armature, because the UI shows the models inside the collection and not inside the armature, or rather it not being in the armature

Just look at the mess you get when importing a single qc with collections, and then without.
Try to figure out which model on the left is not parented to an armature. Its nuts.
You can easily tell on the right (without collection), because they're offset left and right.
Finding the install files
The files you need to edit will be installed in blenders addons folder:
"<Blender Install Folder>\<version number>\scripts\addons\io_scene_valvesource"

Example: "F:\Programme\blender-4.0.1-windows-x64\4.0\scripts\addons\io_scene_valvesource"

Inside this folder you'll see various python script .py files.
We'll edit those with Notepad++. Any editor, even basic notepad will do.
Changing Importer Defaults.
Open import_smd.py

Here's a few things you can do in this file:

Line 46 - doAnim :
This line decides if you should automatically load all animations it can find when importing QC.
Recommended setting: default=False

Line 47 - createCollections :
This is the infamous "Create collections" setting that trips beginners up to no end.
Anytime you import a smd, it would put it into its own collection, which adds more and more collections, to the point that beginners forget which armature a mesh is parented to, because of the way the blender ui is designed.
Recommended setting: default=False

Line 48 - makeCamera :
Whether every single smd import should create a camera.
Why does this even exist?
Recommended setting: default=False

Line 49-53 - append :
This setting is the default setting of what to do with the bones you import.
Do you want to "append them" so the armature mixes with whichever you already have, or do you want to make a new armature for every SMD you import?

It's best to always make a new armature, else you'll always merge all the armatures together, which is a pain to deal with. So we'll use the more sensible default setting.

Recommended setting: default='NEW_ARMATURE'

Line 54 - upAxis :
This lets you pick which axis is your "up axis". Generally there's no real reason to change this.
Recommended setting: default='Z'


Line 58 - rotMode :
Whether you want the imported animation to use "Euler" or "Quaternion" rotation mode.
Default is Euler, and in some cases you might want "Quaternion".
Which to use is entirely up to you.
Recommended setting: default='XYZ'

Line 56 - boneMode :
What default bone shape you want. The default "Sphere", Arrows or "Default".
"Default" simply shows your bones as sticks.
"Arrows" aren't arrows. They're "Empties", which look like a crosshair with the XYZ axis visible.
"Spheres" are the icospheres you're used to.

What value you want is entirely up to you here. This is merely preference.
But i would recommend you to at least change the name of these settings, because "default" is actually supposed to be "Stick", Arrows is supposed to be "Empty" and sphere is technically an IcoSphere.


Speaking of bone shapes, on line 447, you can decide the settings of the icosphere.
ops.mesh.primitive_ico_sphere_add(subdivisions=3,radius=2)
This defines "Smoothness" and size of the ball used for bones.
You could change the radius so all bones are smaller by default, or make it more or less subdivided if you prefer a really smooth ball, or just a blocky ball.

Right below that is the size for the "empty" bone shape, if you wanna change its default size, or empty type.

Here's the general settings i recommend.
Changing other things
Here's a few other things you might want to take a look at.

"Export" button text
The button to export SMD and DMX meshes is simply labeled "Export".
If you add this button to your "Quick Favorites" (by right clicking it) you can press your quick favorite key anywhere and export models or anims without needing to find that button.
However, the only text you'll see in that quick favorite menu is "Export".
I you have multiple things in that quick access menu, this is confusing.

Open GUI.py
Look for
SmdExporter.bl_idname,text="Export"

You'll want to change the "Export" to something like "Export Source Engine Assets".
Since you can export models and animations, depending on what item you selected.


Always Suppress Collection Export
Anytime you export an object from a collection, it merges the whole collection into one smd.
Unless you click through the UI to find and toggle the "Suppress" button.
I personally always suppress this, so not having to enable suppression every time is nice.

Open __init__.py
Look for
description=get_id("group_suppress_tip"),default=False)
Change it to True.

DMX Defaults
DMX models have multiple versions, and you have to pick the correct one for your game.
The default is "Binary 2 Model 1", but for example, L4D2 used "Binary 3 Model 15".
If you always mod the same game, having to switch that around is pretty tedious, So why don't we just make the defautl export settings be the one you always use?

Open __init__.py
Look for
dmx_encoding
You'll get two lines that look like this:


The very last values default='2' and default='1' determine the binary and model version.
Change it to whatever you want. In the case of l4d2, it would be 3 and 15.
Closing words.
Should you need help with this process, join the "Dead 4 Mods" Discord Server[discord.gg].
There's a few members, including me, who can help you out.
If you join and immediately DM me, i'll ignore you. Use the designated channels.

I have my own Discord Server[discord.gg] if you'd like to hop in and chat.
I sometimes post WIP images of what i'm doing, but it's mostly memes.

I also got Paypal[paypal.me] for don't-ations.
2 Comments
Vox 14 Sep, 2024 @ 7:31am 
sweet Jesus that createCollections line genuinely gave me headaches. extremely glad you made this guide lmao thank you
wico. 20 Aug, 2024 @ 7:55pm 
thanks a lot man, made my life much easier.