Please or Register to create posts and topics.

Have any idea for exporting models from Blender to Hammer?

Page 1 of 2Next

Recently I've been learning Blender to make models and have made some models. But it seems very complex to export my models to hammer. I can export them as .fbx. I also got a Blender Source Tool to export them as .SMD or .DMX. As I learned those two file types just conveys the mesh infos and are not actual model files. I need to write some kinda QC file to compile them. Do you guys got any good way to put models in Blender directly to use in 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.

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]
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 :snooze:

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_customboard.mdl"
$body board "board-ref.smd"
$staticprop
$surfaceprop combine_metal
$cdmaterials "modelsprops_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 2portal 2modelsprops_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 2portal 2modelsprops_custom?

"cdmaterials "modelsprops_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 :notwant:

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/.

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!

Can you post the files that you've got so far?

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]
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.

Lol, man, I meant to actually post your files so we can check them out and see what happens :D

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...

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

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.

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!
Page 1 of 2Next