MTS has all free content, all the time. Find out how YOU can help to keep it running. Tell me how...

SMD importer/exporter for blender, Updated Oct 27th

by Bobcatben Posted 28th Aug 2007 at 2:05 PM - Updated 27th Nov 2013 at 9:09 PM by Nysha
105 Comments / replies (Who?) - 25 Feedback Posts
Picked Upload! This is a picked upload! It showcases some of the best talent and creativity available on MTS and in the community.
these plugin scripts for blender will allow you to import and export smd's tailored for the sims 2 for use in simpe.

(i will be updating these every so often as i find bugs/other people tell me about bugs so check the updates at the bottom if you use it)

smd is much more flexible for sims 2 modeling then .obj's

my desire to make this started when i tried to make speakers that could sit on the floor, or on a counter instead of hanging on the wall, and SimPE started misreading the vertex/face count of my .obj's and refusing to import them, then when i found out if i wanted to make a body mesh i couldn't make new/delete vertices's, only move them.

so over the past few days i wrote these 2 scripts for blender, 1 which imports a skeleton/mesh from a smd, and 1 that exports.

ive been testing it since last night and new vertices's work, as do bone weights.

the 2 .py files go in the .blender/scripts/ folder of your blender folder(default is c:/program files/blender/.blender/scripts/), the scripts work in linux too(tested) and most likely on Mac's as well.

the importer is simple enough to use, to export, you need the mesh to be parented to the skeleton(the meshes import this way with the importer to see what i mean), it uses vertex group bone weights for the bone weighting(also imports this way), if no set of bones with a mesh is found, it exports the first mesh it fines, with a dummy bone in the finished smd.

Some common things that might trip you up when exporting..
1, if you have to scale/rotate your mesh from object mode, hit ctrl+A
afterward to apply the scaling/rotation to the actual mesh.

2, dark edges at the ends of shirt sleeves and pants legs is caused by 2 differing angled faces sharing a edge, just apply a edge split modifier to the mesh, and tweak the angle setting till it looks good.

3, if you change bone weights/add new vertices, make sure the total bone weighting for a given vertex is always equal to 1.0(this can cause problems once in game) i may add the option to the exporter to balance any slightly under/overweighted vertices in the future.

4, also, never have more then 4 bones weighting to a single vertex(sims 2 only supports up to 4 bones per vertex)

5, if your mesh has a skeleton(ie, its a body mesh) always have the mesh parented to the skeleton(which can be added to blender by importing a default body mesh and deleting the mesh itself), if it is a static mesh, no bones are needed.

please let me know if theres any improvements i could make/bugs i need to fix

Version updates:
Oct 27th: exporter updated to 0.5, added normalization of bone weights.

Sept 22nd: exporter updated to 0.4, added more error handlers and the ability to convert to triangles if the mesh has quads.

Sept 20th: updated the exporter to 0.3, fixed a bug with not catching vertex groups without matching bones and crashing it.

Sept 12th: updated the importer to 0.3, fixed bugs with normals and merging vertices's with different normals.

Aug 29th: updated exporter to 0.2(fixed a bug with exporting a mesh with no skeleton, eg for non animated things like statues)


Additional Credits:
many other exporter/importer scripts in blender that i looked to for reference/how todo stuff, and the half life smd exporter(doesn't work with sims smd's) that i learned how get the bone rotations from.
Tags: #blender, #mesh, #export, #import, #smd

Operating System: Windows Linux Mac OS X
Utility Type: Meshing Tools
Plugin Type: Blender

You must have the expansion or stuff packs listed below installed to use this custom content. Please see the post text for any exceptions.

Sims 2
Key: - File was updated after upload was posted
Filename - Tip: You can click the magnifying glass to see the archive contents Size Downloads Date
export_smd.zip

Size: 2.1 KB · Downloads: 7,175 · 29th Aug 2007
2.1 KB 7,175 29th Aug 2007
import_smd.zip

Size: 2.1 KB · Downloads: 8,362 · 29th Aug 2007
2.1 KB 8,362 29th Aug 2007
Don't forget to Thank the creator after downloading! Use the Thanks button located above the screenshots above.
Basic Download and Install Instructions:

1. Download: Click the download link to save the .rar or .zip file(s) to your computer.

2. Extract the zip, rar, or 7z file.

3. Place in Downloads Folder: Cut and paste the .package file(s) into your Downloads folder:
  • Origin (Ultimate Collection): Users\(Current User Account)\Documents\EA Games\The Sims™ 2 Ultimate Collection\Downloads\
  • Non-Origin, Windows Vista/7/8/10: Users\(Current User Account)\Documents\EA Games\The Sims 2\Downloads\
  • Non-Origin, Windows XP: Documents and Settings\(Current User Account)\My Documents\EA Games\The Sims 2\Downloads\
  • Mac: Users\(Current User Account)\Documents\EA Games\The Sims 2\Downloads
  • Mac x64: /Library/Containers/com.aspyr.sims2.appstore/Data/Library/Application Support/Aspyr/The Sims 2/Downloads
Need more information?
 
105 Comments / Replies (Who?) - 91 Feedback Posts, 7 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Page 1 of 5
Lab Assistant
#2 Old 28th Aug 2007 at 10:19 PM
Am I stupid or something, because I don't understand what this does exactly.
Can someone explain it for me?
Lab Assistant
Original Poster
#3 Old 28th Aug 2007 at 10:55 PM
its for making meshes in blender that can be imported into the sims 2.
Test Subject
#4 Old 28th Aug 2007 at 11:42 PM
Thanks Bobcat! I haven't run into this problem yet myself, but as they say...

It is better to have it and not need it, than to need it and not have it!
Lab Assistant
Original Poster
#5 Old 29th Aug 2007 at 12:05 AM
besides bypassing the problem i had with objs, smds allow you todo body meshing with bone weights(with objs you cant add or remove vertices's when body meshing cause objs do not support anything but mesh's)
Lab Assistant
#6 Old 29th Aug 2007 at 12:48 AM
I'm a MS3D guy, but this is really a great add-on for those who do use Blender! Thanks!
Inventor
#7 Old 29th Aug 2007 at 7:27 AM
I'm still trying to learn to mesh... x_x An if I put this in can I still use the standard tuts?
[email protected]_o!

At my final resting place
[email protected]_o!
Test Subject
#8 Old 29th Aug 2007 at 10:29 AM
wow! i think i love you
that's so great, i've waited so long for someone to make this, and now you did it! you're my hero!
Lab Assistant
Original Poster
#9 Old 29th Aug 2007 at 2:25 PM
Quote:
Originally Posted by BlueIzumi
I'm still trying to learn to mesh... x_x An if I put this in can I still use the standard tuts?
[email protected]_o!


probably, it super simplifies the process of putting the mesh ingame/getting a mesh out with blender tho, down to mainly just, export the smd, and import into simpe, or export the smd from simpe, and import into blender.
Test Subject
#10 Old 29th Aug 2007 at 4:20 PM
could you recommend a good tutorial that shows how to attach the vertices to the bones?
i don't know exactly how to make it and then i don't know which vertices belong to which bone...

nelde
Lab Assistant
Original Poster
#11 Old 29th Aug 2007 at 5:18 PM
to parent a mesh to bones select the mesh, then the bones and do ctrl+p i think it is, and select parent to armature, then select "name groups".

that will attach the mesh to the bones, then it creates vertex groups named after each bone, you can then add vertices's to the groups with weights, you can also use weight painting.

there is a video tutorial for weight painting in blender here
Field Researcher
#12 Old 29th Aug 2007 at 6:48 PM
Nelde, i was wondering the same thing, but was afarid to ask. -I'm relatively new to blender- Thanks so much for this, Bobcatben, i can't wait to try it out.
Test Subject
#13 Old 1st Sep 2007 at 4:05 PM
I'm not sure if it's a problem on my end or something with the files themselves, but when I tried to extract the plug-ins, WinRAR gave me two errors:
-Cannot create import_smd.py
-Access is denied

I had to get them out with copy/paste. Anyways, I haven't had time to test them, but they look promising Thanks so much for making these, they will definitely come in handy!
Test Subject
#14 Old 1st Sep 2007 at 6:11 PM
Thank you for this. I've often wanted to try my hand at meshing, but 1) didn't have the cash to shell out for 3DMAX/Maya/etc. 2) already knew and liked Blender, and 3) like you, I hated exporting .obj files, especially with UV maps. Great job!
Field Researcher
#15 Old 1st Sep 2007 at 6:18 PM
This is a great plug-in, but I have a question.
How would you regroup? Do you know of a tutorial? Thanks again for this.
Lab Assistant
Original Poster
#16 Old 1st Sep 2007 at 8:00 PM
regroup?, like the vertex groups?
Field Researcher
#17 Old 1st Sep 2007 at 9:45 PM Last edited by simgirl9089 : 1st Sep 2007 at 10:07 PM.
Nevermind, I think I know what I did.
Test Subject
#18 Old 2nd Sep 2007 at 8:17 PM
Okay, I installed the plug-ins and decided to try them on a kitchen counter. I imported the counter mesh with the skeleton, made my new mesh, then parented and assigned it to the skeleton properly. Then after I export my new mesh with the skeleton (I've tried export with the mesh and the skeleton selected, both at once or only one of the two) and try to import it into SimPE, it gives me the error "Index was outside the bounds of the array."

Is there something specific that causes this, or again is it an error on my part?
Lab Assistant
Original Poster
#19 Old 2nd Sep 2007 at 8:27 PM
selected or not doesn't make a difference with it, it finds the first armature with a mesh, or if that fails, it finds the first mesh. make sure your not in edit mode, i think the script pops you out of it but im not sure,
if it still errors pm me and ill pm you my email and you can send me the smd and ill look it over.
Instructor
#20 Old 3rd Sep 2007 at 9:14 AM
I'm not qualified in meshing, but I thank you very much for whatever you've been doing to adapt free programs for TS2.
3D program makers are charging a fortune for a copy. I've been taking a look on some programs and get muscle cramps only by thinking on start. Anyway everything sounds obsolete born. I know by experience that learning a lot of stitch here, sew there mean nothing in terms of learning. A well developped program is self understanding and on the end it will be just a matter of mouse clicks on pull-down menus.
Thanks for your efforts, no matter if I self cannot enjoy at the moment. It will sure contribute for a new better road.
Lab Assistant
Original Poster
#21 Old 3rd Sep 2007 at 2:36 PM
atomic_hamsters, the problem is likely with quads, sims 2 only uses triangles, i forgot to put a error condition in the exporter if the mesh has any quads in it, the mesh should be converted to triangles before export, by going in edit mode, selecting all(A button), and hitting ctrl + T.
Lab Assistant
#22 Old 3rd Sep 2007 at 7:15 PM Last edited by adele_0 : 4th Sep 2007 at 6:19 AM.
Default help?
Hey bobcatben. Basically, you're awesome for making this. I've been so frustrated at the fact that I would have to shell out cash if I wanted to mesh anything, especially when blender is (in my opinion) obviously superior to milkshape, plus... it's FREE!
EDIT: removed images and info about weight issue because the problem was my own dumb mistake
Lab Assistant
Original Poster
#23 Old 3rd Sep 2007 at 8:14 PM
it likely has something todo with the weights, as at first my importer wasn't importing the 1st weight on each vertex, and i was getting similar things happening to the entire body, theres a weight paint mode in blender that might help to see the weights you have etc.
Lab Assistant
#24 Old 3rd Sep 2007 at 9:40 PM
Quote:
Originally Posted by Bobcatben
theres a weight paint mode in blender that might help to see the weights you have etc.


Thanks, I'll try that right now. :D
Lab Assistant
#25 Old 3rd Sep 2007 at 10:18 PM
So.... I'm completely confused. I have no idea what the weights are supposed to look like. Do you know of a weight painting tutorial that I could look at? Or is this a simple thing to fix? I'm a total nooB at this weight stuff.
Page 1 of 5