Modelling in blender, but how do I export to a source model?
26 replies, posted
I already created a model in blender, but I don't know what to do to make it usable in Garry's Mod... I know that model files for source are .mdl. I also already made a working texture which is on it in blender, just so everybody knows.
So again, how do I make a blender model usable (with textures on it) in source? Please help :/
You need to export the model as a .SMD. From there, you need to compile it for use in GMod.
[QUOTE=Katra804;38401474]You need to export the model as a .SMD. From there, you need to compile it for use in GMod.[/QUOTE]
Well, how do I turn it into a MDL and make a VTF for it after that?
Google "compile source QC". Then come back once you hit a specific problem.
I was helping someone on steam with this exact question yesterday, and they'd been looking at this:
[url]https://developer.valvesoftware.com/wiki/Modeling_props_with_Blender[/url]
Seems to contain a lot of the meaty stuff.
If you follow what's on that page, you should come out of it with a Source model.
[QUOTE=one free man;38402677]I was helping someone on steam with this exact question yesterday, and they'd been looking at this:
[url]https://developer.valvesoftware.com/wiki/Modeling_props_with_Blender[/url]
Seems to contain a lot of the meaty stuff.
If you follow what's on that page, you should come out of it with a Source model.[/QUOTE]
Well, I did that, got the model into gmod, but all I get is a prop with the proper shape, but it's an effect and the texture is purple and black squares, which I know means that textures are missing.
Did I do something wrong? I set up the textures, by making the vmf and vtf go in the proper folders, but still no goody.
Yes, you did something wrong (99% of the time). There's something that's directing something else to the wrong place, and the mystery is what. Just run through all of the VMTs and double check to make sure there aren't any inconsistencies. I don't know if you've heard of XVI32 but you can use hex editor (xvi32) to look at what materials the model is calling for and have a complete way to check that everything is directing to the proper place.
[QUOTE=Biscuit-Boy;38405017]Yes, you did something wrong (99% of the time). There's something that's directing something else to the wrong place, and the mystery is what. Just run through all of the VMTs and double check to make sure there aren't any inconsistencies. I don't know if you've heard of XVI32 but you can use hex editor (xvi32) to look at what materials the model is calling for and have a complete way to check that everything is directing to the proper place.[/QUOTE]
Oh, I think I now know why, both the vtf and vmf have the same name. Can that cause issues?
[editline]10th November 2012[/editline]
Err, guess that didn't fix anything. Changed the name of the actual texture and where the vmf goes, still no luck. And also, I tried to use that app, how the hell do I use it >_<
[QUOTE=BlueAndGray;38405040]Oh, I think I now know why, both the vtf and vmf have the same name. Can that cause issues?
[editline]10th November 2012[/editline]
Err, guess that didn't fix anything. Changed the name of the actual texture and where the vmf goes, still no luck. I'll try that app you suggested. And also, I tried to use that app, how the hell do I use it >_<[/QUOTE]
Okay, so I'm just assuming you don't know what a VMT does. The VMT directs the model to the proper VTF, the VMT is the brains of the texture operation. So the VMT needs to give the model the proper path to the VTF, make sure it checks out, and make sure you have a valid VMT (google will help you here as well).
To use XVI32, just open it, open a .mdl, and scroll to the bottom. In the last few lines you can find the names for all of the VMT files the .mdl calls for, you should recognize them as they're the same as the VMTs names hopefully.
[QUOTE=Biscuit-Boy;38405202]Okay, so I'm just assuming you don't know what a VMT does. The VMT directs the model to the proper VTF, the VMT is the brains of the texture operation. So the VMT needs to give the model the proper path to the VTF, make sure it checks out, and make sure you have a valid VMT (google will help you here as well).
To use XVI32, just open it, open a .mdl, and scroll to the bottom. In the last few lines you can find the names for all of the VMT files the .mdl calls for, you should recognize them as they're the same as the VMTs names hopefully.[/QUOTE]
Ohh, so I see. It's looking for the material under "models/". I put the material in a different folder which is in "models/BlueAndGray". Is there a way I could change that from "models/" to "models/BlueAndGray/"?
[QUOTE=BlueAndGray;38405478]Ohh, so I see. It's looking for the material under "models/". I put the material in a different folder which is in "models/BlueAndGray". Is there a way I could change that from "models/" to "models/BlueAndGray/"?[/QUOTE]
Yes. Open the .VMT file with either VTFEdit or Notepad, and then manually type in the different directory and the name of the .VTF it's supposed to read.
[QUOTE=Katra804;38405576]Yes. Open the .VMT file with either VTFEdit or Notepad, and then manually type in the different directory and the name of the .VTF it's supposed to read.[/QUOTE]
Erm... I'm talking about the MDL referring to the wrong vmt, not the vmt referring to the wrong vtf...
[QUOTE=BlueAndGray;38405587]Erm... I'm talking about the MDL referring to the wrong vmt, not the vmt referring to the wrong vtf...[/QUOTE]
Re-assign the .VMT to the model itself after moving it to the proper location, then recompile the model.
[QUOTE=Katra804;38405659]Re-assign the .VMT to the model itself after moving it to the proper location, then recompile the model.[/QUOTE]
Tried that, still doesn't work. What I did is that I put the model (it's this computer thingy) under "BlueAndGray/computers" which is in "garrysmod/models" and then put both the vmt and vtf under "models/" in "garrysmod/materials". Apparently the model is looking for the material there, so I decided to put it there, but like I said, still doesn't work. I have a feeling that I'm doing something wrong... Would you like to look at the SMD and QC of the model?
[QUOTE=BlueAndGray;38409028]Tried that, still doesn't work. What I did is that I put the model (it's this computer thingy) under "BlueAndGray/computers" which is in "garrysmod/models" and then put both the vmt and vtf under "models/" in "garrysmod/materials". Apparently the model is looking for the material there, so I decided to put it there, but like I said, still doesn't work. I have a feeling that I'm doing something wrong... Would you like to look at the SMD and QC of the model?[/QUOTE]
You can't edit the .mdl itself unless it retains the same total number of characters. Aka if you add or remove spaces from the hex it will get messed up.
[QUOTE=BlueAndGray;38409028]Tried that, still doesn't work. What I did is that I put the model (it's this computer thingy) under "BlueAndGray/computers" which is in "garrysmod/models" and then put both the vmt and vtf under "models/" in "garrysmod/materials". Apparently the model is looking for the material there, so I decided to put it there, but like I said, still doesn't work. I have a feeling that I'm doing something wrong... Would you like to look at the SMD and QC of the model?[/QUOTE]
Go ahead and post your .QC, I will take a look. Remember to use the [.code][./code] tags (minus the . in both) before pasting your .QC.
[QUOTE=Biscuit-Boy;38409891]You can't edit the .mdl itself unless it retains the same total number of characters. Aka if you add or remove spaces from the hex it will get messed up.[/QUOTE]
Yeah, I know, all I did was edit the .QC file then recompiling it.
[QUOTE=Katra804;38410086]Go ahead and post your .QC, I will take a look. Remember to use the [.code][./code] tags (minus the . in both) before pasting your .QC.[/QUOTE]
Here you go:
[code]
$modelname desktopcomputer_1a.mdl
$cdmaterials "models"
$scale 15
$surfaceprop "metal"
$body studio "desktopcomputer_1a.smd"
$sequence idle "desktopcomputer_1a_idle" fps 1
[/code]
Try changing cdmaterials to "models\*yourname*\desktopcomputer"
then you'll put the VMTs and VTFs in "materials\models\*yourname*\*desktopcomputer*"
You still need to check the .mdl in XVI32 to see the NAMES of the VMTs you should have, if the VMTs are in the proper folder but have incorrect names they still won't work. And I'll assume that the VTFs called for in the VMT are corresponding properly.
[QUOTE=Biscuit-Boy;38410924]Try changing cdmaterials to "models\*yourname*\desktopcomputer"
then you'll put the VMTs and VTFs in "materials\models\*yourname*\*desktopcomputer*"
You still need to check the .mdl in XVI32 to see the NAMES of the VMTs you should have, if the VMTs are in the proper folder but have incorrect names they still won't work. And I'll assume that the VTFs called for in the VMT are corresponding properly.[/QUOTE]
I did all that you said, but I still can't get it working... In XVI32 it shows that it's looking for the material in the correct directory...
I also used the Material tool (In gmod) with material_override just to make sure the vmf and vtf is working, apparently it is. Material shows like it should be.
[URL="https://developer.valvesoftware.com/wiki/Modeling_props_with_Blender"]This[/URL] article is quite old, new SMD Tools work a little different.
The name of the material in Blender is used as the name of the material for the model, not the texture filename like it was before.
For example, if you have something like this in Blender:
[IMG]http://ompldr.org/vZzhqcw[/IMG]
Your model will use [I]charger.vmt[/I], not [I]dodge_charger_diffuse.vmt[/I] though the texture's filename is dodge_charger_diffuse.tga.
I think that might be your problem.
[QUOTE=BlueAndGray;38411527]I did all that you said, but I still can't get it working... In XVI32 it shows that it's looking for the material in the correct directory...
I also used the Material tool (In gmod) with material_override just to make sure the vmf and vtf is working, apparently it is. Material shows like it should be.[/QUOTE]
Once again, the NAME of the vmt, not the directory. It gives you the NAMES of every VMT the model is going to call on so they need to be matching. Not the directory, the name.
Like Biscuit said, you need to change your $cdmaterials line to something along the lines of what he typed. You also need to make sure the .VMT's and .VTF's are in the proper location (garrysmod/garrysmod/materials/models/*your folder name of choice*/*any sub folders you may or may not have the files in*). If the folder(s) don't currently exist, create them manually. After placing the .VMT's and .VTF's in their proper locations, make sure the .VMT's point to the proper directory and fix them accordingly if necessary (including the names of the .VMT's), then recompile the model.
[QUOTE=Atom_rus;38411677][URL="https://developer.valvesoftware.com/wiki/Modeling_props_with_Blender"]This[/URL] article is quite old, new SMD Tools work a little different.
The name of the material in Blender is used as the name of the material for the model, not the texture filename like it was before.
For example, if you have something like this in Blender:
[IMG]http://ompldr.org/vZzhqcw[/IMG]
Your model will use [I]charger.vmt[/I], not [I]dodge_charger_diffuse.vmt[/I] though the texture's filename is dodge_charger_diffuse.tga.
I think that might be your problem.[/QUOTE]
Err, made sure it's the way you said so, still not working... :(
[editline]11th November 2012[/editline]
[QUOTE=Biscuit-Boy;38411939]Once again, the NAME of the vmt, not the directory. It gives you the NAMES of every VMT the model is going to call on so they need to be matching. Not the directory, the name.[/QUOTE]
So do you mean in $cdmaterials I need to give it the plain name of the material without the path, or with the path?
[QUOTE=BlueAndGray;38411966]
So do you mean in $cdmaterials I need to give it the plain name of the material without the path, or with the path?[/QUOTE]
He wanted you to look for the material's path, not the folder's path(in XVI32).
Can you give your smd and mdl files?
Are you sure that you've done everything correctly in Blender? Your model looks for [I] materials/models/BlueAndGray/desktopcomptuer_1a/material.vmt[/I].
You said your material works fine if you assign it with a tool.
I think you just named it wrong in Blender(unless you really named your material [I]Material[/I], they you probably just have it in a wrong folder).
Your material tab should look like this:
[IMG]http://ompldr.org/vZzhuNA[/IMG]
And then you should have two files:
[CODE]materials\models\BlueAndGray\desktopcomptuer_1a\computer.vmt
materials\models\BlueAndGray\desktopcomptuer_1a\computer.vtf[/CODE]
[QUOTE=Atom_rus;38413718]Are you sure that you've done everything correctly in Blender? Your model looks for [I] materials/models/BlueAndGray/desktopcomptuer_1a/material.vmt[/I].
You said your material works fine if you assign it with a tool.
I think you just named it wrong in Blender(unless you really named your material [I]Material[/I], they you probably just have it in a wrong folder).
Your material tab should look like this:
[IMG]http://ompldr.org/vZzhuNA[/IMG]
And then you should have two files:
[CODE]materials\models\BlueAndGray\desktopcomptuer_1a\computer.vmt
materials\models\BlueAndGray\desktopcomptuer_1a\computer.vtf[/CODE][/QUOTE]
Ohhh, yeah. I see what you mean. I did look at the little materials list and it said "Material" instead of a name I wanted it to be. I renamed the vmt but it's still not working... :(
Sorry, you need to Log In to post a reply to this thread.