Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

Compiling Hats & Attachments For Source


Short
 Share

Recommended Posts

Tools needed.

 

Maya

3ds max (what I'm using for the tut)

Blender

Vtfedit

Guistudiomdl

Smd exporter plugins/scripts

Source sdk (it should come with steampipe games).

 

Step one. Export your model.

 

First make sure your model is zeroed in the world then export the reference (ref.smd) and one sequence with 5 frames (idle.smd). Open the ref.smd in notepad++ and make sure the texture name is correct (jester.psd).

 

NOTE: depending on the attachment type it may need to be rotated a certain way before being exported.

 

522d4731c3d39.png522d474e6cfdd.png522d4cc78d8b4.png

 

Step two. Creating the vmt and vtf.

 

Open up vtfedit and import your texture and use these settings, save your texture as and make sure it matches the above name in the ref.smd.

 

522d4a467d35f.png

 

Next create a vmt with this code, replace the XXX.vtf with the name of the texture you just made (jester.vtf). Make sure the vmt name matches the vtf name.

 

"VertexLitGeneric"

{

$baseTexture "models/player/hgitems/hats/XXX.vtf"

"$phong" "1"

"$phongexponent" "150"

"$phongboost" "1"

"$phongfresnelranges" "[0 1 4]"

"$basemapalphaphongmask" "1"

"$rimlight" "1"

"$rimlightexponent" "4"

"$rimlightboost" "2"

}

 

Copy the vmt and vtf to cstrike\download\materials\models\player\hgitems\hats.

 

Step Three. Compiling your model.

 

Create a qc file with this code, replace the XXX.mdl with the name that you want the model to be (jester.mdl), replace the XXX.smd with the reference model name (ref.smd). The qc and the two smd's should be in the same directory.

 

$modelname "player\hgitems\hats\XXX.mdl"

$body "HG" "XXX.smd"

$cdmaterials "models\player\hgitems\hats\"

$hboxset "default"

$surfaceprop "carpet"

$illumposition 1.280 0.000 80.164

$sequence idle "idle" loop fps 30.00

 

Now open up guistudiomdl and open the qc you just made (I'm using my own app but it does the same thing).

 

522d55a1429cd.png

 

Final step. Check to make sure it works in model viewer.

 

522d5a3663f14.png

 

If you are getting a pink and black checkerboard texture it means it could not find the texture, check your vmt, vtf and ref.smd names.

 

Post any questions below :).

Edited by Short
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share