Source Filmmaker

Source Filmmaker

sonosublime Oct 26, 2014 @ 7:52am
Blender models to SFM
Hi all,

I am embarking on the long journey of learning how to get Blender models into SFM using this excellent and detailed guide:

http://steamcommunity.com/sharedfiles/filedetails/?id=245723825

However, I have little to no experience doing something like this (aside from Blender, I have never used any of the required programs before). I hope that this ongoing topic will help me (and others in my position) to fill in any gaps, and would greatly appreciate any help. Thanks in advance.

These are the problems I am having so far:


1. First of all, I have downloaded the VTF Plugin (Version 1.2.1) for Gimp (v2.8.14). The install instructions for the VTF Plugin state, "To install, extract both the EXE and DLL to your GIMP plug-ins folder. This is typically at C:\Users\<USER>\.gimp-2.8\plug-ins\."

However, there is no 'plug-ins' subfolder in my Gimp folder or any of its subfolders (C:\Program Files\GIMP 2).


2. I have downloaded and installed the VTFEdit (v1.3.3). However, when I try to run it, I get the following message:

"C:/Program Files\Nem's Tools\VTFEdit\VTFEdit.exe

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or used the command-line sxstrace.exe tool for more detail."


3. Am I correct in understanding that for each material channel in the Blender model, there has to be a corresponding VMT (text editor file) and VTF (picture) file - which also have the same names?

Also, I understand that VTFs are exported from Gimp with the VTF plugin, but how exactly do I create the VMT? Can I just save it from Notepad++, replacing the default TXT extension with a VMT extension? Or would that not work?
Last edited by sonosublime; Oct 26, 2014 @ 7:53am
< >
Showing 1-15 of 325 comments
Zappy Oct 26, 2014 @ 7:55am 
1. Make one.
2. Never experienced that, I don't know...
3. Yes, it would work. Notepad++ is recommended.
Pte Jack Oct 26, 2014 @ 1:59pm 
1. VTF Plug in goes in your Program Files\GIMP 2\lib\gimp\2.0\plug-ins folder There should be a ton in there if you installed correctly.

2. Check the Nem's Tools website. you may have to install the additional Window files listed there or turn on some legacy Windows Net Framework drivers.

3. Yes, for each materials channel in Blender there must be a VMT. I usually use VTFEdit to create a simple one when it is time to export and compile so I can view the model in the HLMV or SFM. I use Notepad++ later to tweak the vmts to add phong, cloak, yadda yadda...
sonosublime Oct 28, 2014 @ 1:09am 
Thanks for your very helpful replies. I managed to get all the programs working (VTFEdit by looking on the Nem's Tools comments - apparently my problem was a common one).

I have a couple of new questions, and would greatly appreciate some advice:


1. The guide gives this QC file as an example:


// Identify the model path and name in relation to the models folder
$modelname "testprop/sallyj/sallyjprop.mdl"

//identify the source files to join together to make the model
$model "face-hands" "bodyparts.dmx"
$model "top" "clothmesh_1.dmx"
$model "hair" "clothmesh_0.dmx"
$model "pants" "clothmesh_2.dmx"
$model "shoes" "clothmesh_3.dmx"

// All models must have at least one sequence
$sequence "idle" clothmesh_1.dmx


I think I understand most of it, but am just wondering what exactly the 'clothmesh' stuff means?


2. I know how to save an image from Blender's UV Image Editor (Image/Save As Image), which can then be converted into a VTF file.

But how can I save/export a UV unwrapped image from the UV Image Editor?


3. If I have an object in Blender which has been 'painted' using a material channel with built-in colours (i.e. not an external texture), how exactly can I export that material/colour as an image from Blender?

Thanks in advance.
Last edited by sonosublime; Nov 16, 2014 @ 9:34am
Zappy Oct 28, 2014 @ 10:11am 
1. You can only have 1 $model in a model. Use $body instead. Pte Jack, fix please, if that was in your guide. And "clothmesh" is in the filename of the resources used to compile the model. Usually, you can go with just a single $body, and with pointing $sequence at the same filename as $body.

2. I think Image > Export UV Map or something, but I'm currently lacking resources (my external harddrive) to check it.

3. I don't understand? Blender does not support VMT exporting nor VTF exporting, and I don't understand your question that well, anyway...
Pte Jack Oct 28, 2014 @ 10:57am 
Originally posted by Vintage:
1. You can only have 1 $model in a model. Use $body instead. Pte Jack, fix please, if that was in your guide. And "clothmesh" is in the filename of the resources used to compile the model. Usually, you can go with just a single $body, and with pointing $sequence at the same filename as $body.

The model will still compile with multiple $model statements in the qc, but I agree with you Vintage and $model should only be used if there are facial flexes involved and have changed the guide to reflect $body instead of $model. It is probably why the model compiles with the variuos parts facing different directions before it is defaulted into position in SFM.

//identify the source files to join together to make the model
$model "face-hands" "bodyparts.dmx"
$body "top" "clothmesh_1.dmx"
$body "hair" "clothmesh_0.dmx"
$body "pants" "clothmesh_2.dmx"
$body "shoes" "clothmesh_3.dmx"
Pte Jack Oct 28, 2014 @ 11:45am 
1. Now, if you look at the picture
http://cloud-4.steampowered.com/ugc/594781153973156243/6748B1D59E16DC52711AE69D58ADB46AAC1DC498/
provided in the guide, the clothmesh_#.dmx are the default OBJECT names that make up the model source files for this particular model and are shown in the exportables panel in Blender Source Tools.

If the name of the jacket object had been named "hoodie" instead of clothmesh_1 on the model the exported object dmx file would have been hoodie.dmx instead of clothmesh_1.dmx,
had the pants object been named "pants" instead of clothmesh_2 then the exported dmx would have been pants.dmx instead of clothmesh_2.dmx, etc.
Each separate object that makes the model will have its own model source dmx file.

The QC would have looked like this

$model "face-hands" "bodyparts.dmx"
$body "top" "hoodie.dmx"
$body "hair" "clothmesh_0.dmx"
$body "pants" "pants.dmx"
$body "shoes" "clothmesh_3.dmx"

The break down is $model/$body - qc command
"top/hair/pants/shoes" - the name the objext will take on in the model

bodyparts.dmx/hoodie.dmx/clothmesh_0.dmx/pants.dmx/clothmesh.dmx" - name of the exported model mesh object source file that will make that particular model piece.

The $sequence statement - Every compiled model must have at least one animation sequence in the qc. This is usually the models reference/idle animation. It is a non displayed model and can be as simple as a minute cube inside the model, just a part of the model itself to an actual full animation where the model .


2. yes you can export an unwrapped uv mesh map to a picture...

Select the objebt you want the map and put it into edit mode, change the uv/image editor picture to the texture assigned to the object. select UV (beside the picture picker) and then Export UV Layout. Name the file and point to where you want it saved. see the picture here...

http://imgur.com/ZS8bShg

3. After you've made the changes to the Blender painted image, select Image* and the save option you require. Once saved you can load that image as the actual texture file for the material. If you are changing/painting material in blender as you work you should do an image*/save and a texture refresh as soon as you are happy with the change to avoid losing any changes to the image. (See this picture)

http://imgur.com/q0aJA5E
Zappy Oct 28, 2014 @ 12:33pm 
Originally posted by Pte Jack:
The model will still compile with multiple $model statements in the qc, but I agree with you Vintage and $model should only be used if there are facial flexes involved -
If you agree with me, you should change the first $model to $body as well, since even though there are (likely) flexes, $body (and even $bodygroup) works just fine with DMX flexes. $model should only be used when one fills out the { and } of it. Heck, if you take a look at the sourcesdk_content version of the Engineer's QC(i), $body is used for the main mesh, since there are no eye definitions or anything for him, and thus it'd be a waste to use $model. ...I can't check right now, but I hope I'm right.

Originally posted by Pte Jack:
- It is probably why the model compiles with the variuos parts facing different directions before it is defaulted into position in SFM. -
...I don't understand what you mean? Also, why wouldn't you actually merge the meshes in this case, as they aren't toggle-able in the model? Or at least group them together (using "Add to group" in object data or whatever on the right)?
Pte Jack Oct 28, 2014 @ 1:18pm 
I don't understand what you mean? Also, why wouldn't you actually merge the meshes in this case, as they aren't toggle-able in the model? Or at least group them together (using "Add to group" in object data or whatever on the right)?

If you look at the guide, you would find that this is demonstrating how to piece together a multi-object model in a quick compile, a starter model per-se...

When I spawned the compiled model into SFM, the 4 different object faced different directions until I defaulted the root_transforms. Then the model snapped back together as it should. This particular model did not have bones and was merely a prop type obj compile. Don't bother going into $staticprop or other commands, that was not the intent of the section.

Last edited by Pte Jack; Oct 28, 2014 @ 1:23pm
sonosublime Oct 28, 2014 @ 6:34pm 
Thanks again for the replies guys.

1. and 2. That makes a lot more sense. I'll see if I can get that working when I get home.

3. I don't think I made this question quite clear. Essentially, I am trying to do the same thing as in Q2 (export a UV unwrapped image).

However, I need to do this for an object in Blender that is simply coloured, rather than textured (eg. coloured black). So how exactly can I get this into the UV Image Editor to export it?
Last edited by sonosublime; Oct 28, 2014 @ 6:35pm
Pte Jack Oct 28, 2014 @ 9:23pm 
You want to render a picture of your model from Blender? and it can be coloured just black, (or can it be clay??) you just want a rendered picture of it?

Like this???

http://imgur.com/Di3eGyI
Last edited by Pte Jack; Oct 28, 2014 @ 9:30pm
sonosublime Oct 28, 2014 @ 10:52pm 
No, I don't want to render a picture. I would like to export a 'UV unwrapped' image from Blender, but for an object that is only coloured (using the colour swatch of a default Blender material channel).

It does not just have to be black, but for any colour. I just used black as an example.

The reason I need to know this is because I do not always use external textures for my Blender objects. Sometimes, I simply colour them in Blender.
Last edited by sonosublime; Oct 28, 2014 @ 10:53pm
Zappy Oct 29, 2014 @ 12:08am 
You can use $BaseTexture white coupled with $Color2 "{255 255 255}", where the $Color2 part can be customized to your liking in Red-Green-Blue.
Pte Jack Oct 29, 2014 @ 12:39am 
I don't think that's what he wants. I doing a vid now on baking the textures he's assigned to the uvs in blender. I think that's what he's after.

Edit, I don't do it often enough and keep screwing up the process though!!
Last edited by Pte Jack; Oct 29, 2014 @ 12:46am
sonosublime Oct 29, 2014 @ 12:47am 
Sorry if I'm not making sense. I'm not very good at explaining things. I realise that 'UV unwrapped image' is not the best way of describing what I want to do. I am simply trying to colour Blender objects.

I'm not trying to bake textures (at least, I don't think so?).

Originally posted by Vintage:
You can use $BaseTexture white coupled with $Color2 "{255 255 255}", where the $Color2 part can be customized to your liking in Red-Green-Blue.

So this method could would allow me to assign a colour to a Blender object? Would these commands go in a VMT file or the model's QC file?
Last edited by sonosublime; Oct 29, 2014 @ 12:54am
sonosublime Oct 29, 2014 @ 1:26am 
Pte Jack, I'll PM you once I get home in an hour or so.
< >
Showing 1-15 of 325 comments
Per page: 1530 50

Date Posted: Oct 26, 2014 @ 7:52am
Posts: 325