• How To: Model for Source in Blender
    1,349 replies, posted
I'm making a SourceMod with a buncha friends, and we needed a couple models. Now I don't know about you, but I don't have $3,000 lying around for 3DS Max and I don't intend on pirating it--so naturally, Blender is the best choice here. Free and relatively simple to use once you get past the UI. That's not what this is about, though. If you want to learn about how to use Blender as a beginner, [url=http://www.biorust.com/tutorials/detail/81/us/]this tutorial[/url] should nudge you in the right direction. I may do some "beginners" video tutorials of my own similar to the one below in the future if there is a need. Since originally writing this tutorial, I've made my own Blender script to export to SMD files as the other ones out there either don't work at all or don't export UVs properly. Mine fixes all of that, and I've made a video tutorial to go along with it. Enjoy. [url=http://dvondrake.com/scripts/blendersmd]Download Plugin[/url] [url=http://dl.dvondrake.com/smd_export-old.py]Use this script for animations[/url] (And the top one if you're having root bone trouble) [media]http://www.youtube.com/watch?v=9RTTSACe_eI[/media] idle.smd [code]version 1 nodes 0 "joint0" -1 end skeleton time 0 0 0.000000 0.000000 0.000000 0 0.000000 0.000000 end[/code] material.vmt [code]"VertexLitGeneric" { "$basetexture" "models/props/<materialname>" "$surfaceprop" "metal" "$model" 1 }[/code] model.qc [code]$modelname "props/<modelname>.mdl" $body mybody "<modelname>.smd" $staticprop $surfaceprop "metal" $cdmaterials "models/props" $scale 1 $sequence idle "idle.smd" loop fps 1 $collisionmodel "<modelname>-phy.smd" { $automass $concave } $keyvalues { "prop_data" { "base" "Metal.Medium" } }[/code] run_studiomdl.bat [code]@"c:\program files\steam\steamapps\<username>\sourcesdk\bin\ep1\bin\studiomdl.exe" -game "c:\program files\steam\steamapps\<username>\garrysmod\garrysmod" <model>.qc pause[/code] To spawn your model in the console: [code]sv_cheats 1 prop_physics_create props/<model>.mdl[/code] Anyway, hope you found this somewhat useful. Have fun modeling, and have fun doing it all for free! [b]To use animations:[/b] Simply make your animation just as you normally would with the Action Editor. Select the animation you want to export in there, and do a File > Export > SMD > Animation and you're done. Just use the [url=http://developer.valvesoftware.com/wiki/$sequence]$sequence[/url] command in your QC file to tell Source what your animation is. [b]VTA Exporting[/b] [url=http://filesmelt.com/downloader/smd_vta_export.zip]Here's a modified script by windwakr[/url] that supports VTA exporting. [b]Major credit to Pluss Roland for the original SMD exporter script.[/b]
Well played, sir.
Very nice, I like it.
Many thanks! But what is a good poly count to have as a maximum?
I've made my own Blender script that exports UVs properly, as none of the ones on the VDC wiki work properly. I've also remade this tutorial as a video, as well as added a lot of new content and posted my script in the OP. Enjoy! [QUOTE=Kookas;14955613]Many thanks! But what is a good poly count to have as a maximum?[/QUOTE] Honestly I've never really met any limits or had any models so high-poly that they lag. Just try to make your models as low-poly as you possibly can without compromising quality, and you should be fine.
It looks good, thank you for this, it really helped me!
When i try to export mine says "there is no mesh selected with an attached armature" could you help please?
I have gotten my models in-game perfectly, without textures that is. I just seem to have a disability to be able to get textures on them. And chill_dude, what version of Blender are you using?
the newest i think i dont know how to check it! But im using python script 2.5.2
Wow, this is Awesome! Thanks a lot, friend.
[QUOTE=chill_dude;15010577]When i try to export mine says "there is no mesh selected with an attached armature" could you help please?[/QUOTE] Add an armature in your blender scene. Next, select your model then the armature (using Shift), and hit CTRL + P to parent the armature to the model. Select armature and Don't Create Vertex Groups. Then select the model and export!
You don't need an armature, well at least I don't. You need to make sure to UV Map it properly though, I am expecting you have done that...
How do I add hands to my weapon models? Can I do this in Blender? I would really like to be able to make weapon models as well but have no idea how to add the hands in. Do I need to make my own? Is there some sort of pre-made type...?
Cool!
You don't need armature for my plugin--if you don't have it, it'll automatically add one for you to the export. You also shouldn't have to UV either, unless I've mucked up some code somewhere. As for the hands, my guess is that you can just make your own or mod the CSS ones. I really wish there was some easy way.
I can get the CSS ones? How/where can I get that? They are pretty much perfect for what I need!
-snip- Damnit these forum changes are really pissing me off, every post I make is a double one! :/
I think zbrush is better then blender in my opinion.
You're comparing helicopters to volcanoes here, armopride. Blender is a general multi-purpose app, as Zbrush is pretty much just for modeling. You can't animate in Zbrush, and you also can't export to SMD.
I am getting some errors when trying to export the model into .smd. Plus the ignoring factor is strange because the old script I used to use did not have that. [IMG]http://i62.photobucket.com/albums/h89/Veris_Zaos/scripterror.png[/IMG]
Um... how do I install the script?
[QUOTE=Datsun;15072251]I am getting some errors when trying to export the model into .smd. Plus the ignoring factor is strange because the old script I used to use did not have that. [IMG]http://i62.photobucket.com/albums/h89/Veris_Zaos/scripterror.png[/IMG][/QUOTE] Did you look at the video, by any chance? It clearly says you have to join all meshes together with CTRL+J. I'm not quite sure why you're getting that error about the material index though, but it works just fine for me. You must be doing something funky (which you're already doing). [QUOTE=Beau Phos;15077416]Um... how do I install the script?[/QUOTE] Put it in your scripts folder. Usually one of the following: Windows XP: C:\Program Files\Blender Foundation\Blender\.blender\scripts Windows XP (alt): C:\Documents and Settings\USERNAME\Application Data\Blender Foundation\Blender\.blender\scripts Windows Vista: C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\.blender\scripts
How do I download it? When I click, it is just text.
[QUOTE=dvondrake;15077573](which you're already doing).[/QUOTE] I just used some modeling techniques I picked up when exporting models using Pelle Johnsen's script then exporting using the script you have. Don't assume things. I haven't thoroughly used your script to produce results as of yet.
[QUOTE=Beau Phos;15078012]How do I download it? When I click, it is just text.[/QUOTE] Copy it all into a new file. Name is smdexporter.* or something. You might need Notepad++
[QUOTE=Datsun;15078774]I just used some modeling techniques I picked up when exporting models using Pelle Johnsen's script then exporting using the script you have. Don't assume things. I haven't thoroughly used your script to produce results as of yet.[/QUOTE] That's great, but the video says exactly what to do. No testing needed anyhow, I know it works. (So long as you're doing everything right.) [QUOTE=Beau Phos;15078012]How do I download it? When I click, it is just text.[/QUOTE] Do what Lord Hayden said, or just right click the link and save as.
Great tutorial, though i would like a tutorial on how to make a weapon. Ps. If you intend to make those tutorials, please let me know!
So, are we going to be able to get some hand models any time soon? If not I might have to make a crappy set...
Any chance of an SMD importer for Blender? I find a couple that work but nothing near the level of your exporter. I'm following superaldo's tutorial ([url]http://www.fpsbanana.com/tuts/8485[/url]), and the only importer I find that works with 2.48/9 ([url]http://folk.uio.no/jonmd/blender/smdimport/[/url]) keeps screwing up the textures.
[QUOTE=exequte;15236205]Great tutorial, though i would like a tutorial on how to make a weapon. Ps. If you intend to make those tutorials, please let me know![/QUOTE] Thanks! I'll probably be making more tutorials on how to use Blender from a more-or-less beginner's standpoint over the summer. Nothing as specific as how to make a weapon though, I'm sure there are a lot of other tutorials out there for that already, but more about how to use the different tools and what different techniques you have at your disposal. [QUOTE=Lord Hayden;15286861]So, are we going to be able to get some hand models any time soon? If not I might have to make a crappy set...[/QUOTE] I'm going to be making a hands viewmodel for my SourceMod soon, so I'll be sure to keep it nice and simple so it's easily adaptable to different skins, as well as release it here for other people to use seeing as there's a severe lack of them. :) [QUOTE=mineragua;15372716]Any chance of an SMD importer for Blender? I find a couple that work but nothing near the level of your exporter.[/QUOTE] Possibly in the future, but I've had no use for one as of yet. If I have some free time, sure.
Sorry, you need to Log In to post a reply to this thread.