Source Filmmaker

Source Filmmaker

Skins,bodygroups and textures
So im putting on the finishing touches on my model. However I have issues.
I'll start off with my most difficult problem

I dont understand how to apply the textures. I watched tutorials and looked it up. I know you cant directly apply a vtf to blender. So you need something called tga or something. But when I watched a tutorial by ptejack he uses something called half life model viewer to preview the models texture. I watched him make the vtfs and vmts however what I am not understanding is how to APPLY them. That's the one thing I dont get.

Now for the simpler issues

I looked up how to make skins and bodygroups. I know what you have to do but I dont get HOW to do it. I know about texture groups but in the previews it says "texturegroup "" " what I dont get is, is it supposed to be "texturegroup "meshname""? and then you put the names of the materials bellow? Same goes for bodygroups. The biggest thing that has confused the most is where do you put these commands? In all the vmts that you want to use as a skin? Or do you open the mdl file with notepad++ and it goes there?
< >
Showing 1-15 of 23 comments
Zappy Mar 9, 2020 @ 9:44am 
Originally posted by Wubba lubba dub dub | trade.tf:
- I know you cant directly apply a vtf to blender. So you need something called tga or something. -
That's wrong.

One, TGA is just an image format, like PNG, JPEG, BMP, GIF, et cetera.
In this sort of context, all of those image formats (and more) are interchangeable (although some, such as JPEG and GIF, have lower quality, and should preferably be avoided for that reason).

Two, you don't even need to have the texture in Blender at all.
(There might be a setting that makes it so that DMX/SMD exports use the image name instead of the material name for their materials, but it's definitely disabled by default if it exists.)
You just need to have the texture(s) as VTF(s) for the Source Engine to read, reference the VTF(s) in material VMT(s) for the Source Engine to know how and where to use the VTF(s), and have the model reference those VMT(s).


Originally posted by Wubba lubba dub dub | trade.tf:
- I watched him make the vtfs and vmts however what I am not understanding is how to APPLY them. That's the one thing I dont get. -
In Blender, select (one of) the mesh object(s) in Object Mode, switch to the "Materials" tab, add one or more materials to it, rename the materials to what you want the VMT filename(s) of the finished model to be, switch to Edit Mode, select all faces/n-gons of the model that you want to use material A, select material A in the material list, and click "Assign", then repeat this with materials B, C, D, et cetera if you'd like.

After that, export the DMX/SMD mesh(es), and compile the model afterwards.


Now go to wherever $CDMaterials refers to, relative to -/steamapps/common/SourceFilmmaker/game/[folder]/materials/ ("[folder]" being whichever custom search path you'd like to use for the model).

In here, use VTFEdit,[nemesis.thewavelength.net] or a VTF export plug-in for an image editor, or whichever other method of choice that you'd like, to convert the model's textures into VTFs for Source to read. You may name these VTFs whatever you'd like, since you type the VTF names into the VMTs below.

You may now also make VMT files in this folder, with the same names as the materials in Blender. You may then edit those to be Source materials that look like you want, however that's out of the scope of this comment, and have their texture paths point to the VTFs made above.

Originally posted by Wubba lubba dub dub | trade.tf:
- I know about texture groups but in the previews it says "texturegroup "" " what I dont get is, is it supposed to be "texturegroup "meshname""? and then you put the names of the materials bellow? -
First, you have "$TextureGroup".
After that, you need to list what the texture group is "called", however this is completely unused; it doesn't matter if you leave this as "X", "skinfamilies", "Skins", or even "".
After that, add an opening curly bracket ( { ).
After that, add a pair of curly brackets ( { } ), with the name of each material that you want to change in between. This is skin 0, the default skin of the model.
After that, add a new pair of curly ( { } ), with what you want each material to be swapped with in this new skin. Make sure that you list equally as many materials as with skin 0, in the same order. This is skin 1 (which is the second skin of the model, not the first; it starts at 0).
Repeat the above line for as many skins as you want the model to have.
After that, add a closing curly bracket ( } ).


For example, if you have 2 materials that you want to change, named "head" and "body" (it doesn't matter if they're on the same or separate DMX/SMD files), you could do something like...
$TextureGroup Skins { { "head" "body" } { "head_2" "body_2" } { "head_2" "body_3" } { "head_3" "body" } }
...to change both of them to a second version for the second skin, change the body to a third version for the third skin while keeping the head in the second version, and keep the default body with a third version of the head for the fourth skin.

Originally posted by Wubba lubba dub dub | trade.tf:
- Same goes for bodygroups. -
Team Fortress 2's Engineer has a default normal right arm and glove, as well as a robotic hand (the Gunslinger weapon) as a body-group option, and also a lack of a right arm as a third body-group option.

The way that this is set up could be something like this:
$Body "Player" "Engineer.dmx" $BodyGroup "Arm" { Studio "Right_Arm.dmx" Studio "Gunslinger.dmx" Blank }
In the above example, "Engineer.dmx" is the Engineer's whole body, without the right arm, and "Right_Arm.dmx" is the normal right arm and glove, and "Gunslinger.dmx" is the right arm and robotic hand.

The ~$Body "Player" "Engineer.dmx"~ line adds the "Engineer.dmx" mesh to the model, which can't be disabled. The "Player" part is just the internal name for this mesh, which is what's shown on Source Filmmaker's initial body-group selection menu.

The ~$BodyGroup "Arm"~ line adds a body-group named "Arm", then the opening curly bracket starts the body-group's mesh options, and then the closing curly bracket ends it.

Between those curly brackets, "Studio" means that a mesh file will be listed afterwards, and "Blank" means that it's a null-option (nothingness; for when you want to hide something instead of showing a different mesh file). You don't need to add "Blank" if you don't want to be able to fully hide the body-group.

The first option in a $BodyGroup list will be the option that's used by default. This can be either "Studio" or "Blank", depending on whether you want the body-group to be visible or hidden by default.

Originally posted by Wubba lubba dub dub | trade.tf:
- The biggest thing that has confused the most is where do you put these commands? -
In the QC file that you use to compile the model.
EmperorFaiz.wav Mar 9, 2020 @ 11:41am 
Aside the advice Zappy has given, do read this thread https://steamcommunity.com/sharedfiles/filedetails/?id=245723825

No need to look around for other guides when this is good enough for all the info you need for porting SFM processes.
Pte Jack Mar 9, 2020 @ 11:47am 
Sorry Zappy :TLDR, but did you mention that the first materials in the $textureGroup statement have to be the Materials used in the 3d Editor and are the actual spawn materials?

For example

the original materials used in Blender are head and body to paint the model. In order for the $texturegroup statement to work, the first materials in the group are head and body like:

$texturegroup "name" { { "head" "body"} // these are the materials used in the 3D editor and are the spawn mats // then from here you start making your texture changes { "head_2" "body_2" } { "head_2" "body_3" } { "head_3" "body" } { "head_3" "body" } { "head" "body_2" } { "head" "body_3" } // etc }
Last edited by Pte Jack; Mar 9, 2020 @ 11:48am
Zappy Mar 9, 2020 @ 12:14pm 
Originally posted by Pte Jack:
Sorry Zappy :TLDR, but did you mention that the first materials in the $textureGroup statement have to be the Materials used in the 3d Editor and are the actual spawn materials? -
Yes if you pay attention, but I guess that I can see that it might be easy to miss if reading fast:
Originally posted by Zappy:
-
After that, add a pair of curly brackets ( { } ), with the name of each material that you want to change in between. This is skin 0, the default skin of the model.
-
For example, if you have 2 materials that you want to change, named "head" and "body" (it doesn't matter if they're on the same or separate DMX/SMD files), you could do something like...
$TextureGroup Skins { { "head" "body" } { "head_2" "body_2" } { "head_2" "body_3" } { "head_3" "body" } }
...to change both of them to a second version for the second skin, change the body to a third version for the third skin while keeping the head in the second version, and keep the default body with a third version of the head for the fourth skin.
-
Last edited by Zappy; Mar 9, 2020 @ 12:15pm
Pte Jack Mar 9, 2020 @ 2:28pm 
I knew you would have, but like I said, TLDR:FS (Too long, Didn't read, Fast Scan).

I just added that to emphasize that that spawn material needs to be first in the TextureGroup statement. You and I both know how many ppl don't do this and the textures don't work.
Originally posted by EmperorFaiz.exe:
Aside the advice Zappy has given, do read this thread https://steamcommunity.com/sharedfiles/filedetails/?id=245723825

No need to look around for other guides when this is good enough for all the info you need for porting SFM processes.

Oh I did already. Like I said on the post I just didn't fully understand and needed someone to explain it to me.
Originally posted by Zappy:
Originally posted by Wubba lubba dub dub | trade.tf:
- I know you cant directly apply a vtf to blender. So you need something called tga or something. -
That's wrong.

One, TGA is just an image format, like PNG, JPEG, BMP, GIF, et cetera.
In this sort of context, all of those image formats (and more) are interchangeable (although some, such as JPEG and GIF, have lower quality, and should preferably be avoided for that reason).

Two, you don't even need to have the texture in Blender at all.
(There might be a setting that makes it so that DMX/SMD exports use the image name instead of the material name for their materials, but it's definitely disabled by default if it exists.)
You just need to have the texture(s) as VTF(s) for the Source Engine to read, reference the VTF(s) in material VMT(s) for the Source Engine to know how and where to use the VTF(s), and have the model reference those VMT(s).


Originally posted by Wubba lubba dub dub | trade.tf:
- I watched him make the vtfs and vmts however what I am not understanding is how to APPLY them. That's the one thing I dont get. -
In Blender, select (one of) the mesh object(s) in Object Mode, switch to the "Materials" tab, add one or more materials to it, rename the materials to what you want the VMT filename(s) of the finished model to be, switch to Edit Mode, select all faces/n-gons of the model that you want to use material A, select material A in the material list, and click "Assign", then repeat this with materials B, C, D, et cetera if you'd like.

After that, export the DMX/SMD mesh(es), and compile the model afterwards.


Now go to wherever $CDMaterials refers to, relative to -/steamapps/common/SourceFilmmaker/game/[folder]/materials/ ("[folder]" being whichever custom search path you'd like to use for the model).

In here, use VTFEdit,[nemesis.thewavelength.net] or a VTF export plug-in for an image editor, or whichever other method of choice that you'd like, to convert the model's textures into VTFs for Source to read. You may name these VTFs whatever you'd like, since you type the VTF names into the VMTs below.

You may now also make VMT files in this folder, with the same names as the materials in Blender. You may then edit those to be Source materials that look like you want, however that's out of the scope of this comment, and have their texture paths point to the VTFs made above.

Originally posted by Wubba lubba dub dub | trade.tf:
- I know about texture groups but in the previews it says "texturegroup "" " what I dont get is, is it supposed to be "texturegroup "meshname""? and then you put the names of the materials bellow? -
First, you have "$TextureGroup".
After that, you need to list what the texture group is "called", however this is completely unused; it doesn't matter if you leave this as "X", "skinfamilies", "Skins", or even "".
After that, add an opening curly bracket ( { ).
After that, add a pair of curly brackets ( { } ), with the name of each material that you want to change in between. This is skin 0, the default skin of the model.
After that, add a new pair of curly ( { } ), with what you want each material to be swapped with in this new skin. Make sure that you list equally as many materials as with skin 0, in the same order. This is skin 1 (which is the second skin of the model, not the first; it starts at 0).
Repeat the above line for as many skins as you want the model to have.
After that, add a closing curly bracket ( } ).


For example, if you have 2 materials that you want to change, named "head" and "body" (it doesn't matter if they're on the same or separate DMX/SMD files), you could do something like...
$TextureGroup Skins { { "head" "body" } { "head_2" "body_2" } { "head_2" "body_3" } { "head_3" "body" } }
...to change both of them to a second version for the second skin, change the body to a third version for the third skin while keeping the head in the second version, and keep the default body with a third version of the head for the fourth skin.

Originally posted by Wubba lubba dub dub | trade.tf:
- Same goes for bodygroups. -
Team Fortress 2's Engineer has a default normal right arm and glove, as well as a robotic hand (the Gunslinger weapon) as a body-group option, and also a lack of a right arm as a third body-group option.

The way that this is set up could be something like this:
$Body "Player" "Engineer.dmx" $BodyGroup "Arm" { Studio "Right_Arm.dmx" Studio "Gunslinger.dmx" Blank }
In the above example, "Engineer.dmx" is the Engineer's whole body, without the right arm, and "Right_Arm.dmx" is the normal right arm and glove, and "Gunslinger.dmx" is the right arm and robotic hand.

The ~$Body "Player" "Engineer.dmx"~ line adds the "Engineer.dmx" mesh to the model, which can't be disabled. The "Player" part is just the internal name for this mesh, which is what's shown on Source Filmmaker's initial body-group selection menu.

The ~$BodyGroup "Arm"~ line adds a body-group named "Arm", then the opening curly bracket starts the body-group's mesh options, and then the closing curly bracket ends it.

Between those curly brackets, "Studio" means that a mesh file will be listed afterwards, and "Blank" means that it's a null-option (nothingness; for when you want to hide something instead of showing a different mesh file). You don't need to add "Blank" if you don't want to be able to fully hide the body-group.

The first option in a $BodyGroup list will be the option that's used by default. This can be either "Studio" or "Blank", depending on whether you want the body-group to be visible or hidden by default.

Originally posted by Wubba lubba dub dub | trade.tf:
- The biggest thing that has confused the most is where do you put these commands? -
In the QC file that you use to compile the model.

Very very helpful

But I got two problems

1. I was working on the eye textures and I was making what I named ko eyes cause in dbz if they get hit really hard or are knocked out their eyes are white with a black outline. So I erased the middle of an eye texture and export it as a vtf. But I noticed when I put the vtf in vtfedit the eye came back even though I erased it.
https://imgur.com/OC00m3S
I don't get it

2. Do skins affect uv eyes too? Also do bodygroups remove parts alongside adding them? My model has two different faces and hair and I want them to swap

edit: also where would I put the texture or skin groups in?
Last edited by Sir donks alot (rip my grandpa); Mar 10, 2020 @ 12:25pm
Zappy Mar 10, 2020 @ 1:24pm 
Originally posted by Wubba lubba dub dub | trade.tf:
- I erased the middle of an eye texture and export it as a vtf. But I noticed when I put the vtf in vtfedit the eye came back even though I erased it. -
Maybe you erased the alpha without erasing the colour. Temporarily disable the alpha mask so that you can take a look at the colours (however I can't tell you how to do that, as I don't use GIMP much), then paint over the colours.

Originally posted by Wubba lubba dub dub | trade.tf:
- Do skins affect uv eyes too? -
Yes; Skins swap out some materials on the model for others, regardless of whether or not the materials are used as eyes.

Originally posted by Wubba lubba dub dub | trade.tf:
- Also do bodygroups remove parts alongside adding them? -
No. No mesh-loading QC command can "unload" mesh from another mesh-loading QC command.

Again, you can use "Blank" as a body-group option if you want to make it possible to "hide" the body-group, but you can't affect different/separate mesh-loading commands with it.

Originally posted by Wubba lubba dub dub | trade.tf:
- My model has two different faces and hair and I want them to swap -
Use a 2-option $BodyGroup which loads face/hair 1 in the first option and face/hair 2 in the second option, then make sure that the face and hair aren't present on meshes loaded by $Body, $Model, and/or other $BodyGroups if applicable.

(If you want the face and hair to be toggled independently of each other, simply have one $BodyGroup for the face (and not the hair), and another $BodyGroup for the hair (and not the face).)

Originally posted by Wubba lubba dub dub | trade.tf:
- also where would I put the texture or skin groups in?
I repeat:
Originally posted by Zappy:
- In the QC file that you use to compile the model.
(It doesn't matter where in the QC file it is (as long as it's outside any $BodyGroup, $Model, or other curly bracket pairs and such), just have it somewhere in the QC.)
Last edited by Zappy; Mar 10, 2020 @ 1:25pm
Originally posted by Zappy:
Originally posted by Wubba lubba dub dub | trade.tf:
- I erased the middle of an eye texture and export it as a vtf. But I noticed when I put the vtf in vtfedit the eye came back even though I erased it. -
Maybe you erased the alpha without erasing the colour. Temporarily disable the alpha mask so that you can take a look at the colours (however I can't tell you how to do that, as I don't use GIMP much), then paint over the colours.

Originally posted by Wubba lubba dub dub | trade.tf:
- Do skins affect uv eyes too? -
Yes; Skins swap out some materials on the model for others, regardless of whether or not the materials are used as eyes.

Originally posted by Wubba lubba dub dub | trade.tf:
- Also do bodygroups remove parts alongside adding them? -
No. No mesh-loading QC command can "unload" mesh from another mesh-loading QC command.

Again, you can use "Blank" as a body-group option if you want to make it possible to "hide" the body-group, but you can't affect different/separate mesh-loading commands with it.

Originally posted by Wubba lubba dub dub | trade.tf:
- My model has two different faces and hair and I want them to swap -
Use a 2-option $BodyGroup which loads face/hair 1 in the first option and face/hair 2 in the second option, then make sure that the face and hair aren't present on meshes loaded by $Body, $Model, and/or other $BodyGroups if applicable.

(If you want the face and hair to be toggled independently of each other, simply have one $BodyGroup for the face (and not the hair), and another $BodyGroup for the hair (and not the face).)

Originally posted by Wubba lubba dub dub | trade.tf:
- also where would I put the texture or skin groups in?
I repeat:
Originally posted by Zappy:
- In the QC file that you use to compile the model.
(It doesn't matter where in the QC file it is (as long as it's outside any $BodyGroup, $Model, or other curly bracket pairs and such), just have it somewhere in the QC.)


So I can make this change?
https://imgur.com/E8KYnYA

Is it possible to make different skin groups? Cause I got different eye textures and hair colors. Also damage and bloody textures but I was thinking of making those a bodygroup if its possible
Last edited by Sir donks alot (rip my grandpa); Mar 10, 2020 @ 2:07pm
Pte Jack Mar 10, 2020 @ 4:30pm 
If the face and the other "mask" don't have flexed, then you would chop the same area out of the head so the mask would fit into it and make it a mesh object and change them out using bodygroups.

You would have the head object, then mask1 (the part you chopped out) and mask2 mesh objects.

The head object could have flexes around the mouth area, but not the changeable masks.

The qc would have,

$body "head" "head.dmx"
$bodygroup "mask" {
studio "mask1.dmx"
studio "mask2.dmx"
}

The mask1 would be the default mask that would spawn with the head.

The 2 masks would have their own materials set up in Blender and those and the textures they call would load depending on which mask is visible.

Now if you are exporting DMX files, the masks can have flexes, but the flex names between the 2 masks would have to be different from each other.

Not sure if you can do QC eyes in this case because the masks would have to be called with separate $model command, have the eyeball coords and the eyeflexes defined in the $model statement. (something I haven't tried nor have I figured out a way to do it.)
episoder Mar 10, 2020 @ 5:52pm 
body grouped shader eyes can be done. iirc the engine supports upto 4 eyes (materials and vectors) on a model. iirc on the primary model you gotta have lil hidden geometry inside the head with the secondary eye materials on it. unsure rn tho. i'd have to hop back in and retry that.

on that thought you might aswell add a flex to exchange the eye polygons. haven't tried that.
Last edited by episoder; Mar 10, 2020 @ 5:54pm
Originally posted by episoder:
body grouped shader eyes can be done. iirc the engine supports upto 4 eyes (materials and vectors) on a model. iirc on the primary model you gotta have lil hidden geometry inside the head with the secondary eye materials on it. unsure rn tho. i'd have to hop back in and retry that.

on that thought you might aswell add a flex to exchange the eye polygons. haven't tried that.

damn only 4??? I got more then 4! ;-;
Zappy Mar 11, 2020 @ 6:38am 
Originally posted by Wubba lubba dub dub | trade.tf:
So I can make this change?
-Image- -
Yes, if you do one of the following:
- Remove the upper face from the left model so that the left model is upper-face-less, and have the body-group let you choose which of the two upper faces to use.
- Remove the whole face, or even whole head, from the left model so that the left model is fully face- or head-less, then have the body-group let you choose which of the whole faces/heads to use.


However, given that the upper faces here look much like different "expressions" rather than drastic changes (e.g. entirely replacing something with something else, like adding a cybernetic eyepiece or such), I would probably suggest using a flex, not a body-group, for this.

Originally posted by Wubba lubba dub dub | trade.tf:
- Is it possible to make different skin groups? -
I don't think so.

Originally posted by Wubba lubba dub dub | trade.tf:
- Cause I got different eye textures and hair colors. -
Simply have the first skin be the default appearance, the second skin be different hair with default eyes, the third skin be different eyes with default hair, and the fourth skin be both different hair and different eyes.


(Or if you want the hair and eyes to be swapped in synchronization, just have the first and last of those skins. But if you want them separately changeable, do something like the above.)


Originally posted by Pte Jack:
- Now if you are exporting DMX files, the masks can have flexes, but the flex names between the 2 masks would have to be different from each other. -
They can be the same just fine without any issues, as long as you only store flex definitions in a single of the loaded DMX mesh files.

(This involves using the "advanced" flex definition type in the Blender Source Tools, using a flex-less flex definition file/block for it.)


Originally posted by Wubba lubba dub dub | trade.tf:
damn only 4??? I got more then 4! -
If the character has a single default left eye material and a single default right eye material, that's 2 eyes in this context, regardless of how many different materials those eyes can swap between using skins and/or how many separate mesh pieces use those eye materials.


Whatever attributes you apply to the default left eye material using Eyeball, those same attributes will apply to whatever you swap the left eye material out for using skins as well.
Last edited by Zappy; Mar 11, 2020 @ 6:42am
Pte Jack Mar 12, 2020 @ 7:09am 
Originally posted by Zappy:


Originally posted by Pte Jack:
- Now if you are exporting DMX files, the masks can have flexes, but the flex names between the 2 masks would have to be different from each other. -
They can be the same just fine without any issues, as long as you only store flex definitions in a single of the loaded DMX mesh files.

(This involves using the "advanced" flex definition type in the Blender Source Tools, using a flex-less flex definition file/block for it.)

Hmmm, never tested that. Would you happen to have a sample or screenshots of this somewhere I could look at?
Zappy Mar 12, 2020 @ 8:41am 
Originally posted by Pte Jack:
- Would you happen to have a sample or screenshots of this somewhere I could look at?
If I do, I don't know where. (The place where I thought that I had it, I don't have it. But rest assured that I'm still speaking from experience, even if I don't remember where said experience is.)
< >
Showing 1-15 of 23 comments
Per page: 1530 50

Date Posted: Mar 9, 2020 @ 12:53am
Posts: 23