Insimenator.org

Simmers' Paradise => Tutorials => Topic started by: Tenshii~Akari on September 21, 2008, 12:09:52 am



Title: Sims 2 Bodyshop Meshing with Blender 3D v2.49b: Tutorials #1 & 2 (9/11/12)
Post by: Tenshii~Akari on September 21, 2008, 12:09:52 am
ETA 9/11/12:

The updated version of this tutorial is now hosted on Sim Oasis (http://www.sim-oasis.com/forums/index.php?topic=2916.msg70222#msg70222).
#1 was originally created using Blender 2.45b, but will work just the same in 2.49b. It mainly serves as a way of showing how to import, edit, and export meshes between SimPE and Blender3D, as well as a brief intro into using Blender's interface.

Tutorial #2, after four long years of procrastination, is also finally available (http://www.sim-oasis.com/forums/index.php?topic=2932.msg70732#msg70732).
#2 covers combining two different meshes, as well as intros to editing UV maps and bone weights.



This change is mostly due to the fact that the original post here was screwed up text-wise from the move a few years ago, and I was unable to make edits to it due to character limitations. I didn't want to create yet another thread to make it any more confused looking than it already was, nor did I want to lose any of the questions asked, just in case others that viewed this thread had the same issues. That, and I want to be sure to keep up with my images in one place without stressing my bandwidth limits on Photobucket.  I'll still answer any questions related to this tutorial that are posted in this thread, so no worries on having to sign up there just to get your questions seen.   ;)

(Oh... and if you happen to be viewing this post by means of Google's search engine, you're probably not able to click the links I provided due to you seeing the Wireless Application Protocol version of this thread that it links to.  Just delete the .0;wap2 part in the address bar, then hit Enter to come to the actual forum page.)

Stay tuned for more Sims 2/Blender tutorials on the way!   :cool:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: EKozski on September 21, 2008, 12:47:32 am
You did a great job.

Thank you for the time and effort you put into this.


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: xTERRIx on September 21, 2008, 01:01:21 am
OH MY GOD.

do you know how hard it is to find a decent blender tutorial? thank you SO much tenshii, you inspired me to start meshing with blender in the first place. as soon as i saw your new meshes, i thought "hey! why not give it a try?" this helps so much, i don't have enough words to say how thankful i am! *huggles*


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: miros1 on September 21, 2008, 04:50:04 am
Thank you!


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: BlooM on September 21, 2008, 09:15:06 am
Excellent Tenshii :thumbup:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: MixdCrysy on September 21, 2008, 07:43:43 pm
This is very informative and much needed, thanks!!!


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: jmtmom on September 22, 2008, 08:19:14 pm
I have been looking for this for so long! Thanks loads! I really want to start meshing, but I need a free program. It will take a while, but I hope to start now.


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Netra on September 23, 2008, 09:01:58 am
What a great tut Tenshii!!! Awesome Job!! :P


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on September 23, 2008, 11:01:24 am
Thanks everyone!  Hope this will help those who were wondering about a free alternative to Milkshape3D (despite it's low cost) and any other expensive 3D editors.  Maybe now we'll get more meshers coming out of the works.  :lol:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: jmtmom on October 03, 2008, 08:25:43 pm
OK, so I installed Blender and python, downloaded the Bobcat import and export files, made a "scripts"  folder in C:\Program Files\Blender Foundation\Blender and put them in it,  but I am not getting the Sims 2 options shown in Step 30. I get the pop up message that python is installed when I start up blender.

I've read that python needs to be configured, but the explanations are excessively geeky and I really don't know what I am doing. :smt120 Any help would be greatly appreciated.

UPDATE: I went to: C:\Documents and Settings\MyUserName\Application Data\Blender Foundation\Blender\.blender\scripts  put the Bobcatben files in there and now the option is available, but when I try to import my tutorial mesh I get "python script error, check console"

MOAR UPDATE: After uninstalling and reinstalling blender several times, downloading and replacing Bobcatben's scripts several times. I get this error when I try to import a mesh:

I get the option to import, but I always get this error when I click the OK button.

Sigh, so close and yet so far.


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 04, 2008, 11:02:04 am
:scratch:  Odd... not sure what's going on, but have you tried using a different mesh to import just in case it's something up with that particular .smd file?  I don't recall having ever run across this error before, but hopefully there's a way around it.  :angel:

Or it's also the possibility that Blender 3D has been updated since I last downloaded it... they're up to 2.47... I'm still on 2.45.  :lol:  If it's an issue due to the scripts being "outdated", hopefully Bobcatben will be able to test the scripts out and update them accordingly... due to my lack of programming skills at the moment, I know I wouldn't know what to do with the scripts other than where they're supposed to go.  :lol:

ETA
:  Added a link to the eariler release (or the version I'm still on) to the main post, just in case anyone else has this problem.  Try installing that version to see what happens.  Hopefully if it's an update issue with the scripts, they'll work just fine for you with the 2.45 edition.  :angel:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: jmtmom on October 04, 2008, 01:15:35 pm
Quote from: Tenshii~Akari;1406328
:scratch:  Odd... not sure what's going on, but have you tried using a different mesh to import just in case it's something up with that particular .smd file?  I don't recall having ever run across this error before, but hopefully there's a way around it.  :angel:

Or it's also the possibility that Blender 3D has been updated since I last downloaded it... they're up to 2.47... I'm still on 2.45.  :lol:  If it's an issue due to the scripts being "outdated", hopefully Bobcatben will be able to test the scripts out and update them accordingly... due to my lack of programming skills at the moment, I know I wouldn't know what to do with the scripts other than where they're supposed to go.  :lol:

ETA
:  Added a link to the eariler release (or the version I'm still on) to the main post, just in case anyone else has this problem.  Try installing that version to see what happens.  Hopefully if it's an update issue with the scripts, they'll work just fine for you with the 2.45 edition.  :angel:


I think it's working now. I was trying to open the wrong file, duh! The original project from bodyshop. Now I'm able to open the smd file. I did install V 2.45 too, so I don't know if that helped or if it was just me getting over my attack of stupidity. :smt120


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 04, 2008, 06:55:30 pm
Okay.  Glad you got it solved!  :smile bi:  I'm still going to leave that link up just in case people do run across any issues with the updated version of Blender and the scripts, but thanks for letting me know.  :angel:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: hiyaemma on October 11, 2008, 11:48:02 am
okay, so everything went great for me up until step 16. but the Smd Object Exporter by Skankboy option doesn't show up for me! i get the BumpMapNormals Exporter by Skankyboy, so i'm a little confused if they're the same thing? i tried it but it doesn't work...

do i have to download it from anywhere?


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 11, 2008, 12:21:29 pm
It should be automatically included with SimPE... unless something's up with the AL version.  :scratch:  Have you tried re-installing SimPE to see what happens?  That might help... :dontknow:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 15, 2008, 08:05:51 am
To be honest, I'm not sure if it's safe to do since from what I'm reading around places everything else plugin wise seems to be updated for SimPE... except that .smd importer/exporter skankyboy made.  It's a risky move, but if you're one that's daring to try it, it's up to you, tomyang.  Just make sure you make backups of your stuff beforehand.  

Not suggesting that everyone with the AL SimPE do this for the sake of being able to use this tutorial... I wouldn't want you to mess up anything.  Hopefully there will be an update on the matter soon.  

ETA:  Attaching the .zip file off the SMD importer/exporter here now that it's been confirmed that it's okay to do so... (if I edit my tutorial post, I'll loose over half of the tutorial in the process because of the new forum format allows only 2000 words each post.)  :P  Be sure to install it into your C:\Program Files\SimPE\Plugins folder in order for it to work properly.  ;)


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 15, 2008, 08:47:11 am
:shock:  Oh no!  I hope you didn't take my comment like that...  :lol: I was in no way trying to knock you for suggesting it.  To be truthful I was going to try it myself to see what happens, but then again I don't have any EP higher than Seasons, and the latest SimPE I have is really for up to BV.  ;)  It's just that there are people who are bound to go ahead and do it at the mere suggestion of it and I was letting them know it's probably not wise to do so...  that's what I meant.  Sorry for the confusion in my previous statement.  :smile bi:

It's good to hear that you were able to get a successful mesh out of the mix.  :angel:  Hope all continues to go well in the learning experience!


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: jmtmom on October 24, 2008, 05:31:41 pm
What I want to be able to do is: chop meshes in half so some body types (werewolf, snake) can have shower-proof skintones and attach detailed feet to various body types that don't have them yet.

Would you be willing to give some pointers on how to do that? I'm working through this tutorial and I'm almost done.

I'd also like to know how to resize adult meshes to fit teens.

Luckily, I still have only BV and Simpe version .68


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 24, 2008, 11:30:16 pm
I'll be touching on those points mostly in Part 2, but sure I can give you some tips now.  ;)

Basically it's the exact same method as if you were following the related Milkshape tutorial on MTS2 (http://www.modthesims2.com/showthread.php?t=179177)... only with different tools.  You gather the meshes that you want to take parts from and export their smd files, then import the meshes (and their skeletons) into Blender3D and delete the unneeded parts of the meshes, along with the excess skeletons as you'll only be needing the main skeleton of the base mesh.  (the mesh you intend on replacing after making a new mesh file in SimPE after PSJE extraction).  If you happened to have accidentally deleted that exact skeleton, you can always re-import it into the Blender3D mesh file using the respective .smd file it was exported with, and simply deselect the "Mesh" button when it asks you which parts you want to import.  (the button should be light green to signify it's been unselected)

Once you have those mesh parts properly "chopped" and the extra skeletons removed, you're going to want to make sure you're in Object Mode for this next part.  After you've done that, select (right-click) any mesh part, then select (Shift + right-click) the skeleton in that order.  The selected mesh part should be a dark fuchsia/pink and the skeleton itself should also be highlighted in a lighter shade.  Press Ctrl + P to bring up the "Make Parent to..." menu and select Armature.  Another menu should pop up entitled  "Create Vertex Groups?".  Select the middle option, Name Groups.  The specific mesh part selected should now be properly assigned to the skeleton.  Repeat this for all other mesh parts in the Blender project view.

Afterwards, when all mesh parts have been properly parented, you're going to want to select all of the mesh parts.  (either by pressing the "A" key until everything is selected, or pressing the "B" key and left-click dragging the "selector" cursor over the meshes).  Make sure that one of the mesh parts is highlighted as the main mesh (light pink)... otherwise, if your skeleton is still selected as the main highlighted item, you'll get the "join selected armatures" option instead.  When all the required parts are selected, press Ctrl + J to bring up yet another menu, which asks if you want to join all selected meshes.  Select "yes", and all mesh parts will be joined together into one mesh group.

Now that your meshes are joined together, you can pretty much follow the Unimesh/Milkshape Tutorial Pt3 when it comes to moving the vertices to where you need them to be.  For a better calculation on getting vertices aligned, you can always press the "N" key to bring up a little box in the upper left-hand corner of the 3D View screen.  Whatever vertex is selected, the corresponding coordinates will show up in that box.  :angel:

One more thing needed would be the UV mapping screen and how to use it.  Here's how you do it:

(http://i193.photobucket.com/albums/z195/TenshiiAkari12/Meshing_Tutorial/16b-BLENDER.jpg) (http://i193.photobucket.com/albums/z195/TenshiiAkari12/Meshing_Tutorial/16a-BLENDER.jpg)


   ::smilieiforgetwhi::  See the dark line right in between the main 3D view window and the bottom panel? (right in between the words "View" and "Panel")  Hover your mouse over it until you get the "resize" cursor.  Once that appears, right-click and select the "split screen" option.  A gray vertical line should appear, so make sure it's positioned in the 3D view window.  Once you get it to a reasonable place, left click, and you should have a "double screen" appear. (usually suggested is the middle of the screen, but depending on which side you'll be working on the most, it's really up to you which side gets more space and what not).  

::smilieiforgetwhi::  Choose the "grid-lined" icon in the bottom left-hand corner of either of the top two windows (entitled 3D View) and click on it for more window options.  Find the UV/Image Editor and click on that.  One of your screens should now have a darker gray grid box... that will be where your mesh's UV map will appear when selected in UV Face Select mode (under the same menu as Object Mode and Edit Mode)

The UV Map function in Blender3D is pretty similar to the one in Milkshape when it comes to moving related UV vertices.  It also has similar selecting and vertex movement functions as on the main 3D view of Blender3D.  (right-click: select single, Shift + right click:  select multiple, etc.)  So if you've gotten acquainted with a little of both, it shouldn't be too hard to get once you fiddle around with it a couple of times.  ;)

Back to the mesh editing itself:  There are a couple of noted problems that I have run across when editing or combining certain meshes, especially when it comes to merging vertices together, etc.:

   ::smilieiforgetwhi::  Normals:  Every mesh I've done so far has a slight issue with the normal mapping on the actual mesh itself, mainly noticeable near the sims' necks.  (when you look at a newly imported Blender Mesh in either Bodyshop or the actual game, there's a slight issue of the bottom half of the sims' neck being lighter than the top half, which is connected to the head.  Something that continues to stump me even now...)   For some odd reason, if your meshes aren't "connected" to each other through merged vertices, Blender does a sort of "auto reset" on the original normals, causing some strange seams to show up in places.  I still have yet to figure out a possible solution for this problem, and if you look closely at some of my meshes, it's pretty apparent that those seams are gleaming... :?

::smilieiforgetwhi::  Vertex merging:  When you have two or more vertices selected, you can choose to merge them together by pressing Alt + M and selecting whether to merge them at the first selected, last selected, center-most point, or collapse all selected vertices.  This can be an easy way to get rid of those pesky normal issues if you make a seamless mesh this way... however, in doing this you sacrifice any chance of a sane morph in the process.  (meaning any fat or pregnancy morph you make or merge vertices on will have a guaranteed chance of exploding in-game.)  

There are some possible ways around the issues... I just have to search for them, or anyone who may come up with any viable solution involving ways around those pesky problems are welcome to share them.  :smile bi:

It may be a little hard to get without some visuals, but I'll be sure to get on to Part 2 of this tutorial when I get the chance.  Hope this helps you, jmtmom.  :angel:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: jmtmom on October 25, 2008, 09:49:48 am
Thanks so much tenshii! :D My first attempt was quite bizarre. Somehow I managed to turn the mesh so it was lying down. :rabbit: I'll try it again. The biggest learning curve is working with the meshing program itself. I found some great blender tutorials on you-tube by super3boy here:

http://www.youtube.com/profile_video_blog?user=super3boy&page=6

I'll keep plugging at it. Thanks so much for your helpful tutorials.


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 25, 2008, 10:59:05 am
No problem!  Glad they and the link helped you.  :smile bi:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: buubaby29 on October 29, 2008, 02:22:21 pm
I know how to mesh using Blender...been practicing for some time now....but I want to know how to combine meshes using blender. If you know of any tutorials that will help me, that would be great.

Awesome tutorial though. This is the one that got me meshing. :)

ETA: Is this how you combine meshes? cause if it is....your my new best friend! i really hope so. i'm gonna try it and see if it works! if it does then you get 1 GAZILLION hugs!!! I'll let you know if you get those hugs.

ETA2:  Tenshii~Akari

You have Recieved 100 Gazillion Hugs from Me!

Congrats.

Thank you for the combing meshes mini tutorial for blender. It worked great!!


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on October 29, 2008, 02:41:34 pm
:lol:  Glad it all worked out!  ;)  I'll be sure to clean it up a bit and add pictures in the near future.  :angel:

Also, merging your post together.  Most of the time it's best to edit and add on to an existing post than to double/triple post.  :smile bi:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: carenmrose on November 04, 2008, 05:57:19 am
Ok, HELP!!  When I try to import my edited mesh, I get this error:

(http://i214.photobucket.com/albums/cc99/carenrose/warning.jpg)

Yes, I have added some vertices.  I only subdivided some faces ...  I didn't have any clue that would be a problem ... but now what do I do?  Do I have to make do with the original number or is there a way I can get it to accept the extras?

(I probably sound desparate ... :P)

Edit:  When I try to re-import the original mesh (that I have changed nothing on), it gives me the same message.  

Ok, in case you need to know, SimPE v. 0.64, Blender 2.47. Since I'm editing the afbodycop mesh (ok, or whatever it's called), I had to do the extracting the 4 parts by hand, like you have to do using Milkshape tutorials ... but no big deal there ...


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on November 04, 2008, 09:39:35 am
(I know you might have figured it out already, but just for reference for others.  :lol:)

(http://i193.photobucket.com/albums/z195/TenshiiAkari12/Meshing_Tutorial/12b-FamiliarizeWithGMDC.jpg)

See the box in the lower left with the check-mark boxes? (entitled Models) Depending on which type of mesh you're using, there will either be just one "part", or multiple parts listed in that box.  If you have more than one mesh part selected via those check-boxes, that message will appear.  Make sure that you uncheck the boxes of the parts you don't want to export, and check the box next to the mesh part that you want to export only.  It should work properly after that.  You'll have to do that for each check-box if you want to export any more mesh parts.  ;)


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: carenmrose on November 05, 2008, 11:37:54 am
I am 99% sure that wasn't the problem.  I will definitely check once I can open SimPE again ... (I had Bodyshop open last time I posted, I just closed it, forgot to open SimPE to check the checks, and opened my game. :P  If I didn't have such long loading times, I would do it now ...)

All that to say, I'm almost positive I would have taken notice if there was more than one there, even if I didn't know what to do with it ... but I don't remember anything different about it ...

I will come back with an update when I can actually check, but in the meantime, is there anything else it might be???  :D

ps - thank you for the quick reply!

edit: yes, I was sure, that wasn't the problem


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on November 05, 2008, 12:55:56 pm
Ah... now that I have a clearer head, I know that's not the message box I was thinking of at first.  ("Warning: More than one mesh selected.")  :lol:

I'm not quite sure if it has anything to do with the version of SimPE you have.  (I updated mine up to 0.68, and I haven't had any sort of pop-up with that exact message come up that I recall).  It's most likely because there's far too many faces on that mesh for SimPE to count correctly.  (Just a guess, though) The sub-dividing method is the best way to overcome that issue and bypass having a polycount that even SimPE refuses to acknowledge.  ;)  

The only problem you'll come across with doing it in Blender though, like I mentioned above in the post at the top of this page, there will be some "normal/seam" issues that will show up, and I have absolutely no idea how to work around that yet... the Normals option in Blender is quite limited to either recalculating or inverting/flipping them, and even saving or exporting the mesh seems to reset the ending "seams" on a particular part of a mesh, therefore ending up with a bunch of nonsense "lines" in the subdivided mesh.  :?  Still seeing if it's possible to fix that in anyway, but I'm not having too much good fortune to find a way to prevent all that from happening... :(


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: xTERRIx on November 07, 2008, 08:41:52 pm
heya tenshii :wave:
 
i found a thread here (http://simpeforum.ambertation.de/sims2/New-Simpe-Apartment-dont-appear-3D-Studio-for-import-mesh) that explains the problem with the SMD exporter/importer :wink: hope that solves the problem (i had it too)


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on November 08, 2008, 11:55:50 am
:notworth:  Thanks a lot, Terri! (http://i193.photobucket.com/albums/z195/TenshiiAkari12/Random_Smilies/yay.gif) This will be immediately posted on the "front page news" of this thread.  :lol:


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: carenmrose on November 10, 2008, 04:30:27 am
Ok, yeah, that was the problem, it had too many vertices.  The max SimPE wanted to handle was 2000, this was more :D.  But, that's fixable, running SimPE in "advanced mode."  

I will possibly try to reduce that later.  For now I'll just work with it as it is :D

I discovered this because on that message, I clicked "more details."  Maybe I should have figured that out before!  Duh!
What it told me:
This is just a Warning. It is supposed to keep you informed about a Problem. Most of the time this is not a Bug!

If SimPE is not running in Advanced Mode, the maximum Number of Vertices is set to 2000 and the maximum amount of Faces to 5000.

If you want to Import this Mesh, you have to turn on Advanced Mode. However, Objects with big Meshes will slow down the Game!

Windows Version
Vista

.NET Version:
2.0.50727.312

~~~~~~~~~~~~~~~~~~~~~~~~~
Faces-2618 Vertices-2174
(Not much more than the Maxis count I started with!)
~~~~~~~~~~~~~~~~~~~~~~~~~

Ok, another question, how can I add pieces to a mesh and have them correctly assigned to bones, etc.?


Title: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on November 10, 2008, 06:49:30 am
You know, that's also something I completely forgot about.  I've had mine in Advanced mode for so long, I completely forgot there were different modes.  (http://i193.photobucket.com/albums/z195/TenshiiAkari12/Random_Smilies/animesweat.gif)  

If you already have each part parented to a skeleton in Blender and exported each as individual .smd files, it's basically the same method as importing meshes into the mesh package file... only instead of using the "Replace" option in the Mesh Group Importer window, you just simply leave the option on "Add" and click OK.  The new mesh part will be imported into the file.  If it's imported with the same exact skeleton as the original was, it will also use the same name, texture, and normal/bump maps for that named mesh group.  (i.e. importing the separated arms of a body mesh assigned to the "body" group skeleton/armature, then importing and adding in the torso mesh which is also assigned to the same type of skeleton.)   ;)


Title: Re: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image He
Post by: artsyama on November 13, 2009, 10:42:41 pm
When I try to use the sim mesh extractor in simpe it says unable to start tool plugin.


Title: Re: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image He
Post by: BlooM on November 14, 2009, 07:48:57 pm
When I try to use the sim mesh extractor in simpe it says unable to start tool plugin.

Did you install •Microsoft .NET Framework Version 2.0 and
•Managed Direct X 9c?


Title: Re: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: BSGirl on January 31, 2010, 04:52:05 am
Thanks for the great tutorial!


Title: Re: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: BlooM on June 26, 2010, 06:08:19 am
Hi Tenshi,
Do you know how to turn autosmooth off with Blender?
It ruines the normals on the neck seam with other clothing meshes.


Title: Re: Tutorial: Bodyshop Meshing with Blender 3D v2.45 (Part I) **A Bit Image Heavy!**
Post by: Tenshii~Akari on June 26, 2010, 06:42:50 am
Absolutely no idea.   :'(  I've been trying to figure this out for the longest time now, but I think I've only narrowed it down to the way Bobcatben has it written in his code.  (I'm too scared to edit and try it out, though.)  From the Import script:


#9/12/2007 version 0.3: reAdded importing of normals(results in some duplicate vertices's but fixes the normal problem, still recalculating them, but this keeps it from merging vertices's with different normals)

So... I haven't gotten the gist of Python scripts.  Hopefully someone out there knows how to read/code them and figure out a way to import the normals without recalculating them.    

ETA:  Here are how the actual scripts look like, if anyone is interested:

Code: (import_smd.py)
#!BPY

"""
Name: 'Sims 2 smd file'
Blender: 244
Group: 'Import'
Tooltip: 'imports a smd file from sims 2(doubt it will work on other smd's)'
"""
__author__ = "Bobcatben"
__url__ = ["", ""]
__version__ = "0.3"

__bpydoc__ = """\
"""

#9/12/2007 version 0.3: reAdded importing of normals(results in some duplicate vertices's but fixes the normal problem, still recalculating them, but this keeps it from merging vertices's with different normals)

from Blender import *
from Blender.Mathutils import *
from math import *

def mat(x,y,z,rx,ry,rz):
rotmat = RotationMatrix(rx,4,'x') * RotationMatrix(ry,4,'y') * RotationMatrix(rz,4,'z')
transmat = TranslationMatrix(Vector(x,y,z))
mat2 = rotmat * transmat
del rotmat
del transmat
return mat2

class Bone:
id = 0
name = ""
parentid = 0
matrix = None
def __init__(this,id,name,pid):
this.id = id
this.name = name
this.parentid = pid

def add(a, tup):
if tup in a:
return a.index(tup)
else:
a.append(tup)
return len(a)-1

def import_smd(path):
editmode = Window.EditMode()
if editmode: Window.EditMode(0)
IMPORT_SKELETON = Draw.Create(1)
IMPORT_MESH = Draw.Create(1)
pup_block = [\
('Import Options'),\
('Mesh' ,IMPORT_MESH , 'Import the Mesh?'),\
('Skeleton' ,IMPORT_SKELETON , 'Import the Skeleton?')
]
if not Draw.PupBlock('Import...', pup_block):
return
import_mesh = IMPORT_MESH.val
import_skeleton = IMPORT_SKELETON.val
Window.WaitCursor(1)
name = path.split('\\')[-1].split('/')[-1]
file = open(path, 'r')
scn = Scene.GetCurrent()
Bones = []
faces = []
verts = []
Window.DrawProgressBar(0.0,'')
lines = file.readlines()
for i in range(0, len(lines)):
line = lines[i]
words = line.split()
#do the nodes
if line.startswith('nodes') and import_skeleton:
Window.DrawProgressBar(0.0,'Reading Nodes')
arm = Armature.New('Bones')
arm.envelopes = False
arm.makeEditable()
armob = scn.objects.new(arm,"Bones")
start = i + 1
for i in range(start, len(lines)):
line = lines[i]
words = line.split()
if line.startswith('end'):
break
tmpbone = Armature.Editbone()
bonename = words[1][1:-1]
Bones.append(Bone(int(words[0]),bonename,int(words[2])))
if int(words[2]) > -1:
tmpbone.parent = arm.bones[ Bones[int(words[2])].name ]
arm.bones[bonename] = tmpbone
#do the skeleton
if line.startswith('skeleton') and import_skeleton:
Window.DrawProgressBar(0.1,'Reading Skeleton')
start = i + 1
for i in range(start, len(lines)):
line = lines[i]
words = line.split()
if line.startswith('end'):
break
if len(words) <= 2:
continue
tx, ty, tz = float(words[1]), float(words[2]), float(words[3])
rx, ry, rz = degrees(float(words[4])), degrees(float(words[5])), degrees(float(words[6]))
boneindex = int(words[0])
bone = arm.bones[Bones[boneindex].name]
parentindex = Bones[boneindex].parentid
matrix = mat(tx,ty,tz,rx,ry,rz)
if(parentindex > -1):
parent = arm.bones[Bones[parentindex].name]
parentmatrix = Bones[parentindex].matrix
matrix = matrix * parentmatrix
myhead = Vector([0,0,0,1]) * matrix
mytail = Vector([0,0.1,0,1]) * matrix
myhead.resize3D()
mytail.resize3D()
bone.head = myhead
bone.tail = mytail
Bones[boneindex].matrix = matrix
else:
myhead = Vector([0,0,0,1]) * matrix
mytail = Vector([0,0.1,0,1]) * matrix
myhead.resize3D()
mytail.resize3D()
bone.head = myhead
bone.tail = mytail
Bones[boneindex].matrix = matrix
#do the mesh itself(triangles)
if line.startswith('triangles') and import_mesh:
Window.DrawProgressBar(0.2,'Reading Mesh')
start = i + 1
faceverts = []
facetex = []
for i in range(start, len(lines)):
line = lines[i]
words = line.split()
if line.startswith('end'):
break
if len(words) < 3:
continue
#get the vertex data, excluding normals as they dont like to import correctly
#so we will just have blender recalculate normals at the end, after we remove duplicate vertex's
x, y, z, tx, ty = float(words[1]), float(words[2]), float(words[3]), float(words[7]), float(words[8])
nx, ny, nz = float(words[4]), float(words[5]), float(words[6])
tmp = []
if len(words) >= 10:
for w in range(0,int(words[9])*2,2):
tmp.append([ int(words[10+w]), float(words[11+w]) ])
faceverts.append(add(verts,[x, y, z,nx,ny,nz, tmp])+1)
facetex.append([tx, ty])

#faces every 3 vertex's
if len(faceverts) == 3:
faces.append([faceverts,facetex])
facetex = []
faceverts = []
#now send them to blender.
Window.DrawProgressBar(0.4,'Writing Vertices')
mesh = Mesh.New('Imported Object')
meshob = scn.objects.new(mesh, 'Imported Object')
mesh.verts.extend([[0,0,0]])
for v in verts:
mesh.verts.extend([[v[0],v[1],v[2]]])
mesh.verts[-1:][0].no[0] = v[3]
mesh.verts[-1:][0].no[1] = v[4]
mesh.verts[-1:][0].no[2] = v[5]
Window.DrawProgressBar(0.6,'Writing Faces')
for f in faces:
mesh.faces.extend([f[0]],ignoreDups=True)
mesh.faces[len(mesh.faces)-1].image = Image.GetCurrent()
mesh.faces[len(mesh.faces)-1].uv = [Vector(f[1][0]),Vector(f[1][1]),Vector(f[1][2])]
mesh.verts.delete([0])
mesh.calcNormals()


file.close()
if import_skeleton and import_mesh:
Window.DrawProgressBar(0.9,'Creating vertex groups')
for b in Bones:
mesh.addVertGroup(b.name)
Window.DrawProgressBar(0.95,'Weighting vertices')
for vi in range(0, len(verts)):
for weight in verts[vi][6]:
mesh.assignVertsToGroup( Bones[weight[0]].name, [vi],weight[1],1)
if import_skeleton:
arm.update()
if import_skeleton and import_mesh:
armob.makeParentDeform([meshob], 0, 0)
Window.DrawProgressBar(1.0,'Done')
Window.WaitCursor(0)
Window.RedrawAll()


Window.FileSelector(import_smd, 'Import')

Code: (export_smd.py)
#!BPY

"""
Name: 'Sims 2 smd file'
Blender: 244
Group: 'Export'
Tooltip: 'Exports a smd file tailored for the sims 2'
"""
__author__ = "Bobcatben"
__url__ = ["", ""]
__version__ = "0.5"

__bpydoc__ = """\
"""

#Oct 27th 2007, V0.5: Added Normalization of bone weighting.
#Sept 22nd 2007, V0.4: Added more error handlers.
#Sept 20th 2007, Version 0.3: Added a check for vertex groups with no matching bones.

from Blender import *
from Blender.Mathutils import *
from math import *

armmat = Matrix()

class Bone:
    id = 0
    name = ""
    parentid = 0
    matrix = None
    pos = Vector()
    rot = Euler()
    def __init__(this,id,name,pid,mat):
        this.id = id
        this.name = name
        this.parentid = pid
        this.matrix = mat * armmat

def findbone(name,bones):
    for b in bones:
        if b.name == name:
            return b

def recursebones(bone,bones,pid):
    thisbone = Bone(len(bones),bone.name,pid,bone.matrix['ARMATURESPACE'])
    bones.append(thisbone)
    for b in bone.children:
        if b.hasChildren():
            recursebones(b,bones,thisbone.id)
        else:
            bones.append(Bone(len(bones),b.name,thisbone.id,b.matrix['ARMATURESPACE']))

#rounds it to 6 decimal places
def cleanvalue(value):
    if fabs( value ) < 1e-6:
        return 0
    else:
        return round( value, 6 )

def error(text):
    Draw.PupMenu("Error%t|"+text)

#checks if the object has a child that is a mesh
def hasmeshchild(obj):
    for o in Object.Get():
        if o.getType() == 'Mesh' and o.parent == obj:
            return True
    return False

#gets the first child object that is a mesh
def getmeshchild(obj):
    for o in Object.Get():
        if o.getType() == 'Mesh' and o.parent == obj:
            return o
    return None

def export_smd(path):
    global armmat
    editmode = Window.EditMode()
    if editmode: Window.EditMode(0)
    if not path.lower().endswith('.smd'):
        path += '.smd'
    name = path.split('\\')[-1].split('/')[-1]
    
    #step 1, find a armature with a attached mesh
    foundone = False
    for o in Object.Get():
        if o.getType() == 'Armature' and hasmeshchild(o):
            #arm = Armature.Get(o.getName())
            arm = o.getData()
            armmat = o.getMatrix().rotationPart()
            armmat.resize4x4()
            meshob = getmeshchild(o)
            mesh = meshob.getData(mesh=True)
            foundone = True
            break
    
    #if step 1 fails, find just a mesh.
    if not foundone:
        foundmesh = False
        for o in Object.Get():
            if o.getType() == 'Mesh':
                mesh = o.getData(mesh=True)
                foundmesh = True
                break
        if not foundmesh:
            error("No Mesh or Armature")
            return
    
    #step 2, if theres bones, process
    if foundone:
        Bones = []
        for b in arm.bones.values():
            if not b.hasParent():
                recursebones(b,Bones,-1)
        for b in Bones:
            if b.parentid > -1:
                inverseparent = Matrix(Bones[b.parentid].matrix)
                inverseparent.invert()
                mat = b.matrix * inverseparent
                del inverseparent
            else:
                mat = b.matrix
            b.pos = mat.translationPart()
            b.rot = mat.toEuler()
            del mat
    #step 2.5, if no bones, generate a dummy bone
    else:
        Bones = [Bone(0,'SmdMiscBone',-1,Matrix())]
        Bones[0].pos = Bones[0].matrix.translationPart()
        Bones[0].rot = Bones[0].matrix.toEuler()
    
    #step 3, write the beginning of the file
    file = open(path, 'w')
    file.write('version 1\n')
    
    #step 4, write the bone hierarchy
    file.write('nodes\n')
    for b in Bones:
        file.write("%d \"%s\" %d\n"%(b.id,b.name,b.parentid))
    file.write('end\n')
    
    #step 5, write the skeleton data
    file.write('skeleton\n')
    file.write('time 0\n')
    for b in Bones:
        file.write("%d %f %f %f %f %f %f\n"%(b.id,cleanvalue(b.pos.x),cleanvalue(b.pos.y),cleanvalue(b.pos.z),cleanvalue(radians(b.rot.x)),cleanvalue(radians(b.rot.y)),cleanvalue(radians(b.rot.z))  ))
    file.write('end\n')
    
    #step 6, write the mesh
    file.write('triangles\n')
    for face in mesh.faces:
        file.write('map.bmp\n')
        vi = 0
        if len(face.verts) != 3:
            if Draw.PupMenu("The mesh contains quads, The Sims 2 only supports triangles.%t|Convert to Triangles|Abort") == 1:
                mesh.quadToTriangle()
            else:
                file.close()
                return
        for v in face.verts:
            #write the vertex location
            file.write("0 %f %f %f"%( cleanvalue(v.co[0]),cleanvalue(v.co[1]),cleanvalue(v.co[2]) ))
            #write the vertex normal
            file.write(" %f %f %f"%( cleanvalue(v.no[0]),cleanvalue(v.no[1]),cleanvalue(v.no[2]) ))
            #write the uv coordinate
            try:
                file.write(" %f %f"%( face.uv[vi][0],face.uv[vi][1] ))
            except ValueError:
                error("Mesh has no texture")
                file.close()
                return
            vi+= 1
            inf = mesh.getVertexInfluences(v.index)
            if len(inf) > 4:
                    error("Too many vertex groups on a single vertex, %d (4 max)"%len(inf))
                    file.close()
                    return
            file.write(" %d"%len(inf))
            if len(inf) > 0:
tweight = 0.0
mul = 1.0
for ww in inf:
   tweight += ww[1]
if tweight != 1.0:
   mul = 1.0 / tweight
                for w in inf:
                        thisbone = findbone(w[0],Bones)
                        if thisbone != None:
                                file.write(" %d %f"%( thisbone.id, w[1]*mul ))
                file.write('\n')
            else:
                file.write('\n')
    file.write('end\n')
    file.close()
    if editmode: Window.EditMode(1)

Window.FileSelector(export_smd, 'Export')
   

ETA2:  There is a button for Auto Smoothing in Blender's Mesh Panel, but that's turned off by default.  (If it's a light-green color, it's off)


SimplePortal 2.1.1