I am using Blender 2.75 on steam.
Have any idea for exporting models from Blender to Hammer?
I am using Blender 2.75 on steam.
Freeman|TR wrote:
Do you guys got any good way to put models in Blender directly to use in hammer?
Well, it's not that directly as you think, but you are on the right track: first thing is to get the Source engine plugin for Blender in order to get your .SMD file.
For using your model into Hammer, you need to compile it, but you'll need a .QC file altogether with your .SMD file to be able to achieve this. A .QC file is just a text file where you put all necessary commands that will become the instructions the compiler will read to make your Source engine model.
The more complex your model is, the more complex will be your .QC file and more commands you'll need to include inside.
And for the compiler, Crowbar, no doubt, it's amazing and it's free. It can decompile models as well as compile them very professionally.
That would be the way to go about this.
josepezdj wrote:
Freeman|TR wrote:Do you guys got any good way to put models in Blender directly to use in hammer?
Well, it's not that directly as you think, but you are on the right track: first thing is to get the Source engine plugin for Blender in order to get your .SMD file.
For using your model into Hammer, you need to compile it, but you'll need a .QC file altogether with your .SMD file to be able to achieve this. A .QC file is just a text file where you put all necessary commands that will become the instructions the compiler will read to make your Source engine model.
The more complex your model is, the more complex will be your .QC file and more commands you'll need to include inside.
And for the compiler, Crowbar, no doubt, it's amazing and it's free. It can decompile models as well as compile them very professionally.
That would be the way to go about this.
Thanks for your help! So 1.Export model to .SMD. 2.Write the .QC file. 3.Compile with Crowbar. Got it. Guess I have something new to learn. Hope the QC is easy 
josepezdj wrote:
That would be the way to go about this.
Well, sorry to bother but I met problems when trying to compile the model. The model is blank in hammer with prop_static.
So I got the Blender Source Tool and Crowbar. I do some search and write the QC file in Notepad++ like this:
$modelname "props_custom\board.mdl"
$body board "board-ref.smd"
$staticprop
$surfaceprop combine_metal
$cdmaterials "models\props_custom"
$sequence idle "board-ref.smd"
$collisionmodel "board-ref.smd" { $concave }
Well, actually I kinda have no idea what I am writing cuz I just copy and tweak them. I suppose the .QC file is the only thing I need to edit cuz in Crowbar I just need to enter the location of .QC file but not .SMD file. I have a few questions.
My .SMD file name is board-ref.smd and I don't know where to put this.
So the first line "$modelname "props_custom/board.mdl"". What does this mean? Before compiling there are no .mdl file so I suppose its the output location. In portal 2\portal 2\models\props_custom (I create the props_custom folder myself)? Or it's not the case?
"body board "board-ref.smd"" Does it mean I have to put my.smd file into portal 2\portal 2\models\props_custom?
"cdmaterials "models\props_custom" I am confused about the material stuff. Do I have to export the "material file" from Blender? I just didn't see any option for that.
The last line about collision model. Well, I only got 1 .smd file and got no other collision SMD file. Do I have to create that myself too?
I would be very grateful if you could tell me anything I am missing or the basic guideline to make my model appear in hammer. I do see the age issue of source engine. Never heard any other engine needs some compilation process 
For a collision model, you have to make another .smd. In Blender, you can just create another object and export it separately. You'll want to make sure both of the .smds have the same origin, or else they won't line up in Hammer.
For the materials, Blender is a bit weird. I've never actually been able to figure out how to apply materials correctly for .smd exporting, but it's easy enough to fix after exporting - just open your .smd file in Notepad, and look for blocks like this. In my case, "skin0" is the name of the material applied to that face. Replace that (and every other instance of it in the file) with the name of the .vmt you want to use.
That .vmt needs to be located at the cdmaterials location. For example, if cdmaterials is set to models/props_custom/, the .vmt for the model should be in materials/models/props_custom/.
Idolon wrote:
Your .smd and .qc files have to be in the same folder as each other, but can be wherever you want. The .mdl file is what gets spat out after compiling the model. In your case, a successful compile will get you a .mdl file (and other related files) in models/props_custom/.For a collision model, you have to make another .smd. In Blender, you can just create another object and export it separately. You'll want to make sure both of the .smds have the same origin, or else they won't line up in Hammer.
For the materials, Blender is a bit weird. I've never actually been able to figure out how to apply materials correctly for .smd exporting, but it's easy enough to fix after exporting - just open your .smd file in Notepad, and look for blocks like this. In my case, "skin0" is the name of the material applied to that face. Replace that (and every other instance of it in the file) with the name of the .vmt you want to use.
That .vmt needs to be located at the cdmaterials location. For example, if cdmaterials is set to models/props_custom/, the .vmt for the model should be in materials/models/props_custom/.
Thank you for your help! Actually I figure out the basic workflow to compile a model. But I've encountered new problem. That is after compilation, I do get the .mdl file and a few other files. However in hammer, I create a prop_static and pick my model there. The model just is not there. It doesn't appear. I have shown my .QC file in the post above yours. Could you please check it and help me out what I am missing?
Thanks again!
josepezdj wrote:
Can you post the files that you've got so far?
Ye man.
I name my model "board" so:
I got
board.dx90.vtx
board.mdl
board.phy
board.vvd
board.smd is exported from Blender
borad.qc is written by myself.
At the point you're at, the reason for your problem could potentially be whatever: the model compiler is missing some file and therefore building an uncomplete model, it could be your material files, the location of your files in the P2 folders structure...
If it doesn't appear, it's a model issue.
josepezdj wrote:
Lol, man, I meant to actually post your files so we can check them out and see what happensAt the point you're at, the reason for your problem could potentially be whatever: the model compiler is missing some file and therefore building an uncomplete model, it could be your material files, the location of your files in the P2 folders structure...
https://www.dropbox.com/sh/qmvpqyvpub5t ... pTiMa?dl=0
Many thanks for your patience! I actually am surprised that you guys can examine the files!
I uploaded a folder on dropbox. Let me know if I uploaded it right.
Thanks again!
CamBen wrote:
Also, in model viewer or the hammer model browser click the tickbox "wireframe". If your mesh shows up in wireframe mode but not regular mode, you probably used the wrong type of shader on your textures and the model itself is fine.If it doesn't appear, it's a model issue.
Let me check it out! Thanks!
Anyways, it's weird inside your ref.smd file:
This is the only really weird thing I found in your files. The .QC file, as mentioned before, didn't seem to be the problem... Here inside the reference.smd file you usually find actual material files: "whatever.VMT", "whatever_02.VMT", etc.
Nevertheless, I checked inside your compiled model file (board.mdl) to see what the compiler did, and found this:
This could mean that, despite your weird ref.smd file, the compiler made it so that your model could be looking for the following 3 material files:
- default.vmt
- material.vmt
- danger.vmt
So I made those material files and the corresponding texture files (I simply made 3 plain colours: orange, yellow and pink):
- default.vtf
- material.vtf
- danger.vtf
And placed them into materials/models/props_custom.
And it worked:
SO... your model file seem to have been compiled correctly... All you have to do is to have those 3 material files inside materials/models/prop_custom/.
2nd Approach
I also used a different approach: I replaced those 3 material references inside your ref.smd file by the following ones:
- board_mat_01.vmt
- board_mat_02.vmt
- board_mat_03.vmt
Now, check out in the below image, this is closer to how it should always have looked like:
This way it is referencing to actual material files (.VMT), and therefore after compiling the model and placing the 3 materials files and the 3 texture files (.VTF) in the folder models/props_custom/, it works fine and the model is compiled with the correct materials and paths inside:
This is how it looks like in-game:
I'm attaching all the files (model + materials) of this 2nd approach.
I'm also attaching the material files that your current model is looking for inside your materials/models/props_custom/ folder so that you can put them in place and check how your model file does also work out.
I hope you get all this.
Cheers!
josepezdj wrote:
[url=http://posCheers!
Wow! Thanks again for your detailed analysis!
So the problem is clear now. I realize that, when doing the material work in blender, I actually made a .png picture using mspaint, and imported that into blender. I also used built-in material tool to make another several material with plain colors black, pink, and wooden brown. I thought that it will work out easily. But I didn't know I need .vmt and .vtf material files.
So I guess I need to learn how to make vmt and vtf too. First the QC. Then these two stuff. This perhaps gonna be the last map I do with hammer. Other engines just outsmart source 1...
Many thanks to your effort! I learned a lot from you. Good luck! 





