How can I export a Custom model from blender to Hammer?

lavasap13

L1: Registered
Sep 3, 2023
34
1
I'm currently tying to make a custom TF2 model(static) for my map but I can't find any information on how to do it. The best I could find was a tutorial for garry's mod. I tried following it by downloading blender source tools and then exporting the models from blender as a .smd files, then I made a .qc file with the following commands:

QC Template:
$staticprop
$modelname "yourfolder/yourmodelname"
$scale "1.000000"
$body "Body" "testmodel"
$cdmaterials "models/tutorial/"
$sequence idle "testmodel"
$surfaceprop "metal"
$collisionmodel "testmodel_collison" {
$automass
$concave
}

Opened Crowbar in Set up game and then selected Team Fortress 2, moved to compiler tab selected the .qc file and ended up with these errors:

Crowbar ERROR: The model compiler, "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\studiomdl.exe", does not exist.
Possible causes: The game's SDK or Authoring Tools has not been installed (usually via Steam Library Tools) or the path given to Crowbar (via Set Up Games button) is incorrect.
Crowbar ERROR: The game's "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\gameinfo.txt" file does not exist.
Possible causes: The game's SDK or Authoring Tools has not been installed (usually via Steam Library Tools) or the path given to Crowbar (via Set Up Games button) is incorrect.

Can somebody help me with this?
 

YM

LVL100 YM
aa
Dec 5, 2007
7,158
6,079
I'm not super familiar with crowbar, but I would check that both studiomdl and gameinfo exist at those locations, if you've got steam installed in a nonstandard location, you might need to change the paths to match
 

lavasap13

L1: Registered
Sep 3, 2023
34
1
Solved the issue. It turned out that I need to manually select the path for those files in crowbar because my steam library is set in my D:/ drive with my tf2 folder.

Thanks for the help.
 

Zeus

Not a Krusty Krab
aa
Oct 15, 2014
1,346
561
Solution

lavasap13

L1: Registered
Sep 3, 2023
34
1
THANKS A LOT! This plugin saves a lot of time and effort compare to using crowbar, I don't even need to write a .qc with it, it just exports it with everything I need. I just want to ask one more thing, it's about the texture tab. How do I add a texture to the model? I don't understand what I'm doing wrong.
s1.PNG
 

YM

LVL100 YM
aa
Dec 5, 2007
7,158
6,079
in blender, select the model and go to the materials tab (little red checked sphere toward the bottom right) assign a material and give it the same name as the .vmt you want the compiled model to use
 

lavasap13

L1: Registered
Sep 3, 2023
34
1
Alright, I figured out how to fix it. It's A LOT more work than I have imagined. I needed to download a plug in for blender called Principled Baker that combines all materials and export's them as a .png file. I needed to UV unwrap the whole object in blender to export the batch. I had to apply the .png image as a single texture and export it as .vtf and .vmt file inside the tf/materials folder. Not only that, I needed to search a 4 hours just to figure out that the Relative path in the materials properties inside source ops requires just the folder that those two .vmt and .vtf file are...
I'm amazed by how many steps are required to just import a single object from blender to hammer.
Anyway, THANKS A LOT FOR THE HELP! SourceOps is definetly more convinient than crowbar and Blender source tools.

done.png


All I have left is to figure out how to import animation in hammer.