sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
JMD's Avatar
JMD JMD is offline
Member
 
Join Date: Aug 2006
Location: Oslo, Norway
Posts: 29
Hi!

There was already an import script for Blender for SMD files, but that one does not work anymore, because of updates in the Blender Python API. First I rewrote that script to match the new Blender Python API. But I didn't quite understand the entire script, so I simply wrote my own, new script from scratch.

My script does pretty much exactly the same as the old one did, but for a change, it only works with Blender 2.44 or higher (only tested in 2.44). The script imports the mesh, and the bones (armature) from the SMD file, rigs the mesh using vertex groups and adds textures. To import textures, you need the to have all the images in the same directory as the SMD. To find out what textures you need, I have made a small script that scans through the SMD file and prints the name of those images.

I would like to thank ideasman42 for helping me with the Blender Python API. I don't know the Blender Python API too well, and he helped me when I got stuck.

For more information about the script, read the README files in the ZIP archive.
DOWNLOAD PAGE
Examples of the well-known character Alyx from Half-Life 2:



You need to have a copy of Half-Life 2 / Counter-Strike:Source to extract the models. I might write a tutorial on how to do that some other time, if people want to know how. (That guide would not be Blender-related, and for Windows users only.)

/JMD
#1   Old 23-Aug-07, 09:54   
Reply With Quote


motorsep motorsep is offline
Member
 
Join Date: Jul 2005
Location: Southwest Texas
Posts: 810
Are there any plans for HL2 SMD exporter? Exporting to SMD would be very handy
I wonder if Doom3 md5 exporter can be taken as foundation and transformed into HL2 SMD exporter?
#2   Old 24-Aug-07, 17:41   
Reply With Quote
JMD's Avatar
JMD JMD is offline
Member
 
Join Date: Aug 2006
Location: Oslo, Norway
Posts: 29
motorsep: yes there is a HL2 SMD exporter (not written by me). It can be found at http://forum.moddb.com/thread/13334/. That script is very recently updated (about a month ago), and fully functional (even with support for exporting animations). It has one weakness, though: Every vertex in the mesh you export MUST be attached to at least one bone! This means that even for "static" (non-moving) objects, you need to make a rig. Other than that, it works very good!
#3   Old 25-Aug-07, 16:21   
Reply With Quote
motorsep motorsep is offline
Member
 
Join Date: Jul 2005
Location: Southwest Texas
Posts: 810
Thanks JMD, I have been looking forward to see that script exporting animation
#4   Old 25-Aug-07, 18:36   
Reply With Quote
puh puh is offline
Member
 
Join Date: Sep 2006
Posts: 38
JMD: fantastic work, thank you very much!
I'd like to ask though: do you have plans of adding animation also? If so - this script could open Blender for making mods for Source engine. Sweet.
Thank you for any answer!
#5   Old 06-Sep-07, 07:08   
Reply With Quote
puh puh is offline
Member
 
Join Date: Sep 2006
Posts: 38
Hi,

I tried to add animation import into the script. But i still have no clue how to get quaternion from bone's tail and head (it seems i can't use method toTrackQuat(track, up) in this case, am I?). Could someone help me to finish this script? I would be much obliged...
Oh, and right now to import animation you have to use initial script from JMD to import reference model, then use this script to import action into existing model.

Here is link to the file:
import_smd_animation.py

Thanks anyone for any reply
#6   Old 01-Oct-07, 09:47   
Reply With Quote
blendkiller^^'s Avatar
blendkiller^^ blendkiller^^ is offline
Member
 
Join Date: Sep 2008
Posts: 40
well it's great but how can i use it(the steps please)thx
#7   Old 21-Sep-08, 16:09   
Reply With Quote
Squinty Squinty is offline
Member
 
Join Date: Aug 2008
Posts: 5
This is probabley a stupid question but ive installed the script and cant find any SMD files, could someone please tell me where to look ( i was looking around in the steam folder)
#8   Old 08-Feb-09, 21:30   
Reply With Quote
tatsuyame tatsuyame is offline
Member
 
Join Date: Oct 2007
Posts: 252
You won't find any smd's just floating around. As far as I know, you have to extract .mdl's from the .gcf files, then decompile them into .smd's. I think...not really sure lol.
............................................
yay
#9   Old 08-Feb-09, 22:47   
Reply With Quote
Ircov_Stega Ircov_Stega is offline
Member
 
Join Date: Mar 2009
Posts: 1
not working for me, I have Blender version 2.48a and Python 2.52-30

there is no script subfolder so I created one, didn't help...
#10   Old 30-Mar-09, 06:29   
Reply With Quote
Lasphere's Avatar
Lasphere Lasphere is offline
Member
 
Join Date: Feb 2006
Location: Denmark
Posts: 1,156
Yearh, I had the same problem. Check this thread. The .blend has been relocated. :/
............................................
My Animationmentor rig are not available anymore becuse of request from Animationmentor.

Rigs rigs everywhere
Blenderartist thread

www.lasserb.dk
#11   Old 17-Apr-09, 19:51   
Reply With Quote
hammer-of-doom hammer-of-doom is offline
Member
 
Join Date: Jul 2009
Posts: 1
Thanks, going to give this a try.
#12   Old 10-Jul-09, 19:19   
Reply With Quote
Dune2k's Avatar
Dune2k Dune2k is offline
Member
 
Join Date: May 2008
Posts: 65
I tried this script with .smd models exported from GTA IV models with Spark IV. Works good.

Thanks.
............................................
'Living is thinking, create good thoughts...'
#13   Old 11-Jul-09, 15:57   
Reply With Quote
NPickle's Avatar
NPickle NPickle is offline
Member
 
Join Date: Jun 2006
Location: Denver Colorado
Posts: 11
First, thanks JMD for the wonderful script. I pulled out some characters out of Team Fortress 2 and got them into Blender with the script and the whole nine yards. Now here comes the newb question.

When I import static mesh with textures the model loads just fine. I change the draw type to textured and the skin looks perfect. Now here is the problem when I render the texture does not show up on the model. Also, it does not look like a material has been created. If I save, exit and return, the texture will be gone. Has anyone else done this? Am I missing a step, I am sure it is something obvious.

Many thanks.
Jim
#14   Old 02-Sep-09, 04:00   
Reply With Quote
NPickle's Avatar
NPickle NPickle is offline
Member
 
Join Date: Jun 2006
Location: Denver Colorado
Posts: 11
Never mind ... got it. Went in to the outliner. Made the material local ... assigned it and good to go.
#15   Old 02-Sep-09, 04:55   
Reply With Quote
david38 david38 is offline
Member
 
Join Date: Jul 2010
Posts: 8
Here is an extension to import animations
http://lsa-svn.svn.sourceforge.net/v...20importer.rar
#16   Old 22-Jul-10, 14:34   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 17:21.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Blender Headlines
Featured Artwork
Crocodile by Julia Korbut
Classic vintage look renders by HANGAR
Blending life - Old George by bigbad
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Social BlenderArtists