[TUTORIAL] Blender and the Source Engine

Micnax

Back from the dead (again)
aa
Apr 25, 2009
2,109
1,585
I'm having a problem with materials too, though it's making it clear that it can't find the file paths to them (even though they're correct!). I'm using Crowbar which shouldn't make a difference.

Some pictures:
tf2matproblem.png tf2matproblem2.png

QC file:
Code:
$ModelName "props_sweetwater\urban_crate002.mdl"

$StaticProp

$BodyGroup "Body"
{
   studio "urban_crate002_reference.smd"
}

$SurfaceProp "wood"

$Contents "solid"

$MaxEyeDeflection 90

$CDMaterials "models\props_sweetwater"

$texturegroup skinfamilies {
   { "urban_crate002_skin0" }
   { "urban_crate002_skin1" }
   { "urban_crate002_skin2" }
}

$CBox 0 0 0 0 0 0

$BBox -74.459 -40.263 -3.536 77.299 39.773 78.631

$Sequence "idle" {
   "urban_crate002_anims\idle.smd"
   fadein 0.2
   fadeout 0.2
   fps 1
   loop
}

And yes, the VMTs are set to VertexLit and not LightmapLit
 

MaccyF

Notoriously Unreliable
aa
Mar 27, 2015
914
1,544
I'm having a problem with materials too, though it's making it clear that it can't find the file paths to them (even though they're correct!). I'm using Crowbar which shouldn't make a difference.

Some pictures:
tf2matproblem.png tf2matproblem2.png

QC file:
Code:
$ModelName "props_sweetwater\urban_crate002.mdl"

$StaticProp

$BodyGroup "Body"
{
   studio "urban_crate002_reference.smd"
}

$SurfaceProp "wood"

$Contents "solid"

$MaxEyeDeflection 90

$CDMaterials "models\props_sweetwater"

$texturegroup skinfamilies {
   { "urban_crate002_skin0" }
   { "urban_crate002_skin1" }
   { "urban_crate002_skin2" }
}

$CBox 0 0 0 0 0 0

$BBox -74.459 -40.263 -3.536 77.299 39.773 78.631

$Sequence "idle" {
   "urban_crate002_anims\idle.smd"
   fadein 0.2
   fadeout 0.2
   fps 1
   loop
}

And yes, the VMTs are set to VertexLit and not LightmapLit

did you name and apply the material urban_crate002_skin0 in blender? also it might be worth changing $CDMaterials "models\props_sweetwater" to $CDMaterials "models\props_sweetwater\" in the qc (idk if it makes a difference though)
 

Tumby

aa
May 12, 2013
1,084
1,190
also it might be worth changing $CDMaterials "models\props_sweetwater" to $CDMaterials "models\props_sweetwater\" in the qc (idk if it makes a difference though)
Makes no difference, I have multiskin models without a \ at the end.
Can we have the VMTs please? HLMV usually doesn't show which files it could not find.
 

Micnax

Back from the dead (again)
aa
Apr 25, 2009
2,109
1,585
did you name and apply the material urban_crate002_skin0 in blender? also it might be worth changing $CDMaterials "models\props_sweetwater" to $CDMaterials "models\props_sweetwater\" in the qc (idk if it makes a difference though)
Yes, the material is applied in Blender (did a render to test it), and I tried the $CDMaterials variant too.

Here's one of the VMTs (the others are the same, just the basetexture path changed)

Code:
"VertexlitGeneric"
{
   "$basetexture" "models/props_sweetwater/urban_crate002_skin0"
   "$surfaceprop" "Wood_Crate"
   "%keywords" "tf"
}
 

Simulacron

L-3: Simulated Member
aa
Feb 17, 2016
313
326
I'm having problems with making the hitbox. I create all of the hitbox out of individual shapes, so all of them are convex. After that I tie them together to one object using Ctrl + J. But the collision model still gets created as a convex shape, that uses all the boxes, but doesn't represent the concave shape anymore.
To make it simple my problem is displayed pretty good with these two pictures from the valve devloper community:
Collisionmodel I make and want:
Blender-table2.jpg

Collision model I get:
Blender-table3.jpg

(Note that both pictures are not mine, don't show my model, and are from this website: https://developer.valvesoftware.com/wiki/Modeling_props_with_Blender)
I also added the $concave tag in the qc file, so it should compile the model properly.

Edit: I figured it out. I forgot to put smoothing groups on the collision model and the mesh, which caused guistudiomdl to compile the model incorrectly.
 
Last edited:

Scampi

L4: Comfortable Member
Feb 8, 2017
186
151
Hate to say it, but I'm having texture errors as well. I've recompiled the razorback crate from the leaked sfm beta assets in order to try and make a useable prop out of it (will repeat this for almost everything there if I can), and I can't get the textures to load. According to the model viewer, it's loading the right materials and VTM, but the texture simply won't show up.
upload_2019-7-6_0-51-39.png

I recompiled the material and texture files as well, VTF is version 7.2 and I'm certain everything is setup correctly. What could be going wrong?

(also worthy of note is that I barely know what I'm doing and consider all of this to be black magic)
 

Scampi

L4: Comfortable Member
Feb 8, 2017
186
151
Here you are. Contains everything related, including a preserved file structure. Hopefully this is some dumb little typo or something. I can't tell what's wrong, but I bet a pro can.
 

Attachments

  • somethinghereiswrong.zip
    1.1 MB · Views: 307

Tumby

aa
May 12, 2013
1,084
1,190
Here you are. Contains everything related, including a preserved file structure. Hopefully this is some dumb little typo or something. I can't tell what's wrong, but I bet a pro can.

The only problem I can find is that the physics model uses the material "Material.001". I'm pretty sure it has to use a a valid material, even though it's not visible. So just give it the material "razorback_crate".

Unrelated, but consider saving the texture with DXT1 compression, as it doesn't have an alpha channel.
 

Scampi

L4: Comfortable Member
Feb 8, 2017
186
151
The only problem I can find is that the physics model uses the material "Material.001". I'm pretty sure it has to use a a valid material, even though it's not visible. So just give it the material "razorback_crate".

Unrelated, but consider saving the texture with DXT1 compression, as it doesn't have an alpha channel.

I'm trying that right now, it only lets me use "razorback_crate.001". If I change it to just "razorback_crate", the other model gets switched to the version that ends in .001. I recompiled with the physics model using that incorrect version, but the textures predictably still won't work.
 

Scampi

L4: Comfortable Member
Feb 8, 2017
186
151
Don't just rename the material. The materials are two different things and therefore need to have two different names.
You need to replace the material.
upload_2019-7-6_20-45-50.png
Hrmm, still nothing. If you compile it yourself, do you see the same results?
 

DioJoestar

L2: Junior Member
Jul 1, 2014
71
167
You VMT is searching a VTF called razorback_crate inside the boxes folder. $basetexture must have the full path with the filename.

"VertexLitGeneric"
{
"$basetexture" "models/boxes/razorback_crate/razorback_crate"
"$surfaceprop" "wood"
}

lEANr7V.png


The only problem I can find is that the physics model uses the material "Material.001". I'm pretty sure it has to use a a valid material, even though it's not visible. So just give it the material "razorback_crate".

Unrelated, but consider saving the texture with DXT1 compression, as it doesn't have an alpha channel.

The phys model doesn't need to have a material, even if Blenders gives advisories when exporting.