STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
279
IN-GAME
1,739
ONLINE
Founded
8 November, 2013
All Discussions > Help > Topic Details
CUSTOM MADE CHARACTER TO SFM. HOW???? EXACTLY???
So I made a character model on Blender alright. I worked hard on making a mesh, I have a very simple armature, only based purely on a skeleton (no other extra stuff yet like face riging and no animation), and I made my very own texture from texture painting which appears as an image on my computer.

What I want to know is by using the source tools provided as the addon, how do I make my creation appear on source filmmaker in the most simplest way you can put it. I know it is a very complicated procedure but please try to simplify it but still explain how to do it, if there is a process i need to do, not only say i have to do it but how exactly do I do it.

My knowledge and understanding of blender and source is pretty LIMITED and I have no idea what I am doing past of the point of finishing a model in the way I described.

I dont know my blender version and dont know how to check but Im pretty sure its the most modern one because I downloaded from the website less then a month ago.
My source addon from what blender is telling me when I click "check for updates" is the latest, 2.5.3 and its installed.

In the clearest and simplest way possible, explain the process of putting my CHARACTER creation (my mesh, my basic skeletal rig, and my texture) to Source Filmmaker in one nice character model like a SCOUT.
< >
Showing 1-11 of 11 comments
Zappy 27 Jul, 2015 @ 2:00am 
Dependencies: Blender, Blender Source Tools, Source FilmMaker, Windows.
Additional dependencies for these instructions: Notepad++, VTFEdit (later).
Useful QC commands: https://developer.valvesoftware.com/wiki/Category:QC_Commands, although I'll tell you all you need to know for now.

- First thing you wanna do is open Notepad++, go to Plugins > Plugin Manager > Show Plugin Manager, find "NppExec", tick it on, install it, and reboot Notepad++ (though you can close it for now).
- In Blender, select the armature, go to pose mode, and make sure the vertices of the mesh move around with the bones of the armature. If you haven't done that, look up a tutorial on weight-painting/rigging for Blender.
- Select the mesh(es) you want to export, go to the scene properties, configure it like http://sta.sh/013zscme7uoj and try exporting. (Click "Export", then choose the files you want to export.) It will export to the export directory chosen, with the file names of the Blender object names (or group names, if things are grouped together).
- If you get an error about too many weights, you can set the "Weight Link Cull" to 1, or use SMD instead. Just make sure to keep the Blender session saved somewhere! If you plan on using flexes ("shape keys" in Blender) at any point, I recommend DMX.
- Now you can go back to Notepad++. Copy-paste the following:
$ModelName X $Body X Y $Sequence Ref X FPS 1 $CDMaterials X
Edit the X-es as you wish. $ModelName refers to the model location (for example "player/scout.mdl" for the Scout in Team Fortress 2. The X in $Body refers to the internal name (basically unused, just use "Body"). The Y in $Body refers to the SMD or DMX file to load (for example "Scout.dmx", with the extensions optional). $Sequence is just something important. Just direct the X to the same file as $Body is using. $CDMaterials is where the materials are expected to be (for example "models/player/scout" for the Scout). The materials themselves use the same names as the materials assigned in Blender. (Can provide an image if requested.)
- Save that file together with your DMX or SMD file(s), and call it whatever you want (for example "Scout.qc"), as long as you make sure the extension is QC, not QC.TXT or anything like that.
- Now press F6 in Notepad++ with that QC file still open. You should get a little "Execute..." box pop-up. In that box, copy-paste the following:
"C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\bin\studiomdl.exe" -nop4 -r -game "C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\usermod" "$(FULL_CURRENT_PATH)"
Now click OK. That command will be saved for the next time you want to use it. This uses the QC to compile the DMXes/SMDs into a Source model file. If you get any errors, copy-paste them from the console thing at the bottom of Notepad++, so I can look at them.
- Launch Source FilmMaker, but choose "Open SDK" instead of "Launch Source Filmmaker". Now click "Model Viewer", and go to File > Load Model..., and browse to "usermod" of Source FilmMaker's directory, then go to models and whatever you put as $ModelName. If everything has gone good, you should now get your model... except pink-black checkered.

Tell me when you've done this, and I will go to the texturing part.
Last edited by Zappy; 27 Jul, 2015 @ 2:51am
Well i tried and nothing came out to the folder that model viewer would recognize. Then there was a big single error that stoped the entire thing.

My custom character's name is "Steve"

"C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\bin\studiomdl.exe" -nop4 -r -game "C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\usermod" "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models\Steve.qc"
Process started >>>
qdir: "c:\program files (x86)\steam\steamapps\common\sourcefilmmaker\game\usermod\models\"
gamedir: "C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\usermod\"
g_path: "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models\Steve.qc"
Building binary model files...
Working on "Steve.qc"
DMX Model c:\program files (x86)\steam\steamapps\common\sourcefilmmaker\game\usermod\models\Steve.dmx
ERROR: Too many bone influences per vertex!
ERROR: Aborted Processing on 'C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models'
<<< Process finished. (Exit code -1)
================ READY ================
This was the qc i made
$ModelName "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models"
$Body "Body" "Steve.dmx"
$Sequence Ref "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models" FPS 1
$CDMaterials "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models"
Another Character model i tried doing ended up like this. It had no armature at all.
QC
$ModelName "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models"
$Body "Body" "Plane.dmx"
$Sequence Ref "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models" FPS 1
$CDMaterials "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models"

Console
Process started >>>
qdir: "c:\program files (x86)\steam\steamapps\common\sourcefilmmaker\game\usermod\models\"
gamedir: "C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\usermod\"
g_path: "C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models\plane.qc"
Building binary model files...
Working on "plane.qc"
DMX Model c:\program files (x86)\steam\steamapps\common\sourcefilmmaker\game\usermod\models\Plane.dmx
ERROR: Too many unified vertices
ERROR: Aborted Processing on 'C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\usermod\models'
<<< Process finished. (Exit code -1)
================ READY ================

Last edited by Colonel Jack O'neill; 27 Jul, 2015 @ 10:46pm
Zappy 28 Jul, 2015 @ 3:05am 
1. I think I said you have to use SMD or set the "weight link cull" (in Blender) to 1 if Blender would give an error about "too many bone influences" or such.

2. A model always needs an armature, (almost) no exceptions.

Also, it should be $ModelName "Steve.mdl", $Sequence Ref "Steve.dmx" FPS 1, and for example $CDMaterials "models/steve" (if you want materials to be in usermod/materials/models/steve).
DONE!! Everything worked perfectly. It appears in model viewer. Sorry such a noob at this but I finally got it. Now whats next?
Oh and another thing, when I checked out the model in source filmmaker, it looked very small. How much blender units in scale should it be to look like a normal character in source?

Also in Addition, not really a big problem but point me in the right direction, only the spine bones appear has bones while everything else is in the unknown section as dots.
Last edited by Colonel Jack O'neill; 28 Jul, 2015 @ 11:49am
Zappy 28 Jul, 2015 @ 11:56am 
Not sure, but I think you now go install VTFEdit 1.3.3[nemesis.thewavelength.net] if you haven't already, and then open it up.

- Go to File > Import, find one of your model's textures (if you have them saved outside Blender), and an import dialogue should pop up. Make sure "Texture Type" is RGB888 for Normal, RGBA8888 for Alpha, and the "texture type" is "Animated Texture". Make sure "Generate Mipmaps", "Resize", and "Generate Normal Map" are all turned off. Go to the "Advanced" tab, and make sure the version is 7.4 or 7.5 (preferably 7.5). Click "OK" at the bottom-right, and provided your texture has power-of-two width and height, your texture should now appear in VTFEdit! Horray! Don't worry, the settings will be saved for next time you import another texture.
- Now go to File > Save As..., and navigate to SourceFilmmaker/game/usermod/materials. If the "models" folder doesn't exist (materials/models, not usermod/models!), create it, and go in, otherwise just go in. Make a folder called "steve", go in there too, and save the VTF texture as what name you want (for example "body"). Usually you should make the VTF texture have the same name as the Blender material you want to use it for (unless it's shared between multiple materials).
- Import and save the rest of the textures, if there's more than one.
- Now for setting up the material(s). Go to Notepad++, double-click to the right of the file tabs to make a new empty file, and copy-paste the following:
VertexLitGeneric { $BaseTexture models/steve/body $BaseMapAlphaPhongMask 1 $Phong 1 $PhongExponent 20 $PhongBoost .3 $LightWarpTexture models/player/pyro/pyro_lightwarp $PhongFresnelRanges "[.3 1 8]" $Rimlight 1 $RimlightExponent 4 $RimlightBoost 2 $CloakPassEnabled 1 $AmbientOcclusion 1 }
This is assuming the VTF file is called "body.vtf", and it's not to be transparent. Change $BaseTexture if you want to. If you use spaces in the file name, you have to use quotes around it in the material. Now go to File > Save As..., navigate to the steve folder, and save it with the name of the Blender material, just make sure the extension is ".vmt" (and not ".txt" or ".vmt.txt")!
- If you've done and named it correctly, your model should now appear textured in both Source FilmMaker and the model viewer. If not, let me know. If you want shiny or transparent textures, let me know for that too. Or if you have normal maps.
Zappy 28 Jul, 2015 @ 11:59am 
Originally posted by Colonel Jack O'neill:
Oh and another thing, when I checked out the model in source filmmaker, it looked very small. How much blender units in scale should it be to look like a normal character in source?
Well, the Scout from Team Fortress 2 is about 81 standard Blender units tall. If you don't want to scale in Blender, you can add "$Scale X" to the QC before $Body and $Sequence, where X is a number (1 being 100%, 2 being 200%, 0.5 being 50%, and so on). Just make sure to re-compile the model.
Originally posted by Colonel Jack O'neill:
Also in Addition, not really a big problem but point me in the right direction, only the spine bones appear has bones while everything else is in the unknown section as dots.
Preferably, you should simply name the bones like Team Fortress 2 bone names, Half-Life 2 bone names, Left 4 Dead bone names, or some other bone namings that appear how you want your model to appear. That will both fix the "Unknown" thing and the lack of lines between bones thing. Also might make your model able to use the rig_biped_simple rig if your model is set up correctly.
Last edited by Zappy; 28 Jul, 2015 @ 12:01pm
Ok for the most part it works. Thank you so much!!!!
ill be sure to post this on the workshop when i get a change when i finish the other characters im working on. Ill give acknowledgments to you.
You saved my modeling hobby!!

There was a problem, I have glasses on the model but it only appears if i look at it from behind. I remember on blender I put everything together as one mesh.

Oh and another thing, just in case i might need the other stuff you mention. can you post how to make the shiny or transparent textures and other things like that because i might need to make a custom window or something transparent eventually down the road like for a map.
Zappy 28 Jul, 2015 @ 3:08pm 
Originally posted by Colonel Jack O'neill:
There was a problem, I have glasses on the model but it only appears if i look at it from behind. I remember on blender I put everything together as one mesh.
In Blender, click N with the mouse in the viewport to open the thing on the right if you've closed it, and tick on Shading > Backface Culling. Now look at your model (in Edit mode) from all angles you can. Whenever you don't see something you should be able to, select it, duplicate it (Shift+D), hit Esc/Escape to not move it anywhere, press T to open the left thing if you've closed it, and click Shading / UVs > Shading > Normals > Flip Direction. (Make sure to select stuff by placing the mouse over it and pressing L, to avoid not selecting the whole thing.) Once done, you can turn off Backface Culling again, and re-export your model.
Originally posted by Colonel Jack O'neill:
Oh and another thing, just in case i might need the other stuff you mention. can you post how to make the shiny or transparent textures and other things like that because i might need to make a custom window or something transparent eventually down the road like for a map.
Well, you can either add $Alpha X, where X is a number between 0 and 1, to make a whole material transparent by that amount (1 = fully visible, 0 = fully invisible, 0.5 = half transparent), or you can add $Translucent 1 to make the texture derive its transparency from the alpha of $BaseTexture.

However, unless there are parts that are only partially transparent, you should preferably use $AlphaTest 1 instead of $Translucent 1, and you should only have transparent parts use a transparent material for the sake of ambient occlusion.

Speaking of ambient occlusion, for transparent things, whether it's $Alpha, $Translucent or $AlphaTest, you should always change $AmbientOcclusion to 0.

To make stuff shiny, either increase $PhongBoost and/or $PhongExponent, or add $EnvMap Env_CubeMap. The first uses phong (the white highlights on models), the second a cubemap. For $EnvMap, you can also add $EnvMapTint "[R G B]" to control the intensity, with 1 being full, and 0 being no shininess. Useful if an object gets too bright or is only supposed to be a little shiny.
< >
Showing 1-11 of 11 comments
Per page: 1530 50

All Discussions > Help > Topic Details
Date Posted: 26 Jul, 2015 @ 8:31pm
Posts: 11