model texturing problems

I’m trying to port a model to gmod, and it’s in, but with a purple checkered texture. I have no idea how to set the texture in blender, and I’m not sure if my qc is correct. Any help?

Here’s the entire file:https://www.dropbox.com/sh/harcms5sbv39bu8/AABZXUwEepTpPN4tjRkDf-3Xa?dl=0

Here’s the QC

[lua]
$modelname “models/helmet/eodhelmet.mdl”
$body mybody “reference.smd”
$staticprop
$cdmaterials “models/helmet/”
$scale 1

$sequence idle “idle.smd” loop fps 1

$collisionmodel “collision.smd” {
$automass
$concave
}

$keyvalues
{
“prop_data”
{
“base” “Metal.Medium”
}
}

[/lua]

The $cdmaterials path is relative to \materials, so if your material is in game\materials\helmet\my_material.vmt, you need to set it to $cdmodels “helmet/”. Usually you’ll want it under something like materials\models\helmet\ though, so it won’t show up in the Hammer browser.

You probably don’t need the $staticprop command.

The Blender tools export the names of the materials applied to the mesh:

I went to the material setting but there wasn’t any texture there. I know I may be asking a lot, but could someone try to compile the model with the texture? I just can’t seem to get it right.

Maybe you should read more tutorials.

  1. $cdmaterials is relative to ROOT/materials, so if you keep your qc, your textures have to be in ROOT/materials/materials/helmet. While that would work, ROOT/materials/models/helmet would be more logical.

  2. Textures are applied to the reference, you can look it up by opening the smd in really any text editor. You’ll see “Material.001” repeated many times in the triangles part. That is the texture the model will try to use.

  3. I hope you didn’t try to use the .png as texture, because that’s not how the Source engine works. You’ll have to convert the png into a vtf and write a vmt file for it. Google should give you more than enough tutorials.

  4. While the model does have UV mapping, it is a bit screwed up on some parts. The texture also is a bit strange. Iunno what the alpha channel was supposed to be, so i just left it untouched.

  5. The collision mesh isn’t alligned with the helmet. You will have to do that in whatever model editor you use.

It doesn’t need the texture itself. Just rename the material in that box to what you named your .vmt file. If the box is empty, press the New button below it.

Weird, I tried compiling it, and the collision mesh aligned itself properly.

Yeah, I removed $staticprop and it completely unalligned the collision mesh. Readded it, but the collision mesh allignment still isn’t too great.

I’ve tried editing the QC, renaming the vmts and vtfs and it still has a purple and black checker texture. If anyone manages to get that damned helmet into gmod with textures, I will love you.

Maybe you could give us more informations about your vmt, vtf, qc, smd, folders etc so that we can help you achieve the same. I used the zip you uploaded and gave you some tips.
Also some information about what the alpha channel is supposed to be would be nice.

I uploaded the “normal” file, not exactly sure if that helps, though.

The vmt and vtfs are called “haloeod” and are located in materials/models/helmet/
the .mdl file is located in garrysmod/models/HaloHelmet/

this is the current .QC
[lua]
$modelname “HaloHelmet/eodhelmet.mdl”
$body mybody “reference.smd”
$staticprop
$cdmaterials “models/helmet/” //forgot to put name of texture
$scale 1

$sequence idle “idle.smd” loop fps 1

$collisionmodel “collision.smd” {
$automass
$concave
}

$keyvalues
{
“prop_data”
{
“base” “Metal.Medium”
}
}
[/lua]

this is the .vmt
[lua]
“VertexLitGeneric”
{
“$basetexture” “helmet/haloeod”
}
[/lua]

[editline]value[/editline]
Apparently the .vmt didn’t include the filename. Thanks for the help everyone :slight_smile: