This tutorial was compiled using these tools and assumes
you have these in working order prior to begining this tutorial.
- the smd export script (currently under constructionhere)
- Blender v2.37 link
- python 2.3 link
- hl2 compile toolkit http://www.fileplanet.com/152009/150000/fileinfo/HL2-Compile-Toolkit (my prefrence, you can compile your smd as you want)
- and of course half life 2
At the moment the script can only export relatively simple models (no-multifoding or animating yet)
so i will be using a simple cube.
The export script uses local coordinates so make sure the models local axis are pointing in the direction you want (i.e the same as global is a good a idea)
so the center of your model should be "on the ground" ie. its center point should be at the base of the object
(this isn't that important and will work to varying degrees of success with different centers but hl2 likes to have there it for physics)
To change the center of the object place your 3d curser at the position you would like the center to be.
then Goto the editiing panel(F9) and press "centre curser" on the mesh dialog.
Keeping your 3d curser there add an armature to the model (i found having the origin of the armature and model the same avoids errors in when it comes to ragdoll models)
set the bone rotation coords to 0 the same as you did with the object and make it rouhgly the size of your object:
go into object mode and select you model THEN the armature an hit ctrl+p to parent the object with the armature i did "to armature - create groups from closes bones"
(for more complex models you will need to edit each bones associated verts which is beyond the scope of this tutorial at the moment)
we are almost there if you export now you will get an error saying you need a "reference action"
so were going to add one.
open up the action editor and make a new action called "reference" (or renain the default one)(see screen)
select your armature and go into "pose mode" select all bones ("A" key) then insert a keyframe ("I" key)
the keyframe should now appear in the action editor window with the name('s) of your bone('s) mine is just called "bone"
(you should name these usefull names if you have more than one as you have to edit there constrains from within the HLMV the half life model viewer)
Come out of pose mode into object mode and select you model again.
go into "uv face select" mode and set the second window (always a good idea to have another) to "uv/image editor"
select all faces on the object and do a "lscm unwrap" ("u" key -> lscm unwrap)
this probably will not look to hot by default so you want to select less surfaces and unwrap those first (until you get something with wich you can work with like so...)
you dont need to load a skin into blender to get it to work but its always good to make your own skin
im just going to use one that i already know is in hl2 called "skin".
now the export script uses the material name not your uv image name for its output so make sure that is set to the correct name..
now that your set up you model goto "file->export->half-life 2 (.SMD)"
type in a suitable name and press export.
your model should export to a working smd file ready compiling into hl2 .
comments and suggestions to Mod-"NO_SPAM"gl0we@gl0we.com (remove the "NO_SPAM")
|