Why is my hat clipping? (CF'S StudioCompiler)

So i’m trying to compile an smd using Cannonfodder’s StudioCompiler, but i’m pretty confused. I can get the model in game, like this:

https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-ash3/1378045_534609793279713_797187927_n.jpg

But as you can see, it’s not textured and it isn’t bound to the bip_head.

I skinned the hat to the bip_head in Blender and exported it as an SMD, but i’m not sure where the texture comes into the compiling process (i compile it separately to create a VMT. right?)

Anyways i’m not worried about the texture, why is my hat not attached to the pyro? What do i need to set the parameters in Studiocompiler to for my hat to work. Cheers.

Ah okay, so now the hat moves with his head, but it floats above his head. Is that something wrong in the qc. or the smd? or something?