Texture problems [Blender to Source]

This is the second time I try to do a simple model in Blender for Source and fail, so I’m here asking for help.
This is how the model should look like:


And this is how my books.qc looks like:

But it ends looking like this shit:


I’ll put the paths here:
For models - common\Half-Life 2\hl2\models
As for materials - common\Half-Life 2\hl2\models\books\materials

I guess it has something to do with the material paths, but I still don’t know how to fix it, and it’s driving me insane. Please, any help will be welcomed!

$cdmaterials	books/materials

Change that to:

$cdmaterials	models/books/materials/

Remember, $cdmaterials is always relative to game/materials/.

Nope, it didn’t worked…

If you get the infamous purple checkerboard it’s caused by breaking one of these rules:

-The texture name in your SMD must match the name of your VMT.
-The $cdmaterials location must match your VMT location.
-The $basetexture name and location must match your VTF name and location.

It can be only one of those three things. If all three seem correct and it still errors check again.

-Snip, Joe beat me to it.-

Shit, I still can’t manage to do it. I must be stupid or something.
I remade entirely everything.
Textures are now in this path: Half-Life 2\hl2\materials\models\books
And the vmt looks like this:

	"$basetexture" "Program Files (x86)\Steam\steamapps\common\Half-Life 2\hl2\materials\models\books"
	"$surfaceprop" "Wood_Panel"
	"$envmap" "env_cubemap"
	"$normalmapalphaenvmapmask" 1
	"$envmapcontrast" 1
	"$model" 1
	"$selfillum" 1

and the qc file looks like this:

$modelname	"books\books.mdl"
$body books	"books.smd"
$surfaceprop	Wood_Panel
$cdmaterials	"Program Files (x86)\Steam\steamapps\common\Half-Life 2\hl2\materials\models\books"
$scale	4

$sequence idle	"books.smd"

Remember, everything is relative to game/materials.

So right now it’s looking in “Program Files (x86)\Steam\steamapps\common\Half-Life 2\hl2\materials\Program Files (x86)\Steam\steamapps\common\Half-Life 2\hl2\materials\models\books”

Also, you didn’t specify your VTF.

Try this.

$cdmaterials models/books/

$basetexture "models/books/vtf_name.vtf"

And substitute vtf_name for the name of your VTF file.

This is what I get when I compile the qc file

ERROR: c:\program files (x86)\steam\steamapps\common\half-life 2\hl2\models\book
s\books.qc(7): - bad command $basetexture
ERROR: Aborted Processing on 'books\books.mdl'

And as I’ve seen here that command doesn’t exist for QC files.
Oh, and thanks a lot for helping me!

Put the $basetexture in your VMT and $cdmaterials in your QC.

It’s still wrong, I don’t know why.

Does the file name of the texture match the one in the materials tab in blender?
You might need to export the model again.

Oh, that might be the reason. Does the texture need to be in .tga or .vtf in the blender material tab?

Needs to be .vtf

This isn’t necessary. Just so long as the name is the same, you don’t need to put in the file extension.

I’ve compiled up a quick screencap of the relevant information in terms of materials for you to use as reference.

Oh, thank you all!
But I still get the checkboard texture… Could I see your qc file as an example?
Or maybe it has something to do that I use Cycles render instead of Blender Render?
EDIT: I finally did it!


And, for the next chapter, I’ll try to add a hitbox and scale it up a bit. Right now those books are for ants.

Here is the code from my qc file. Idk too much about the QC stuff so some of it might be missing or unnecessary, but the models work for what I need of them.

$modelname		"endoftomorrow\door_interior.dmx"
$cdmaterials	"models\endoftomorrow\"


$scale 10

$body door_interior	"door_interior.dmx"
$surfaceprop	wood

$sequence idle	"door_interior.dmx"

I think I’m missing a collision mesh, but I don’t need it myself.