Replies: 81 (Who?), Viewed: 74951 times.
Page 1 of 4
Lab Assistant
Original Poster
#1 Old 12th Sep 2007 at 4:19 PM Last edited by Bobcatben : 14th Sep 2007 at 6:32 PM.
Default Tutorial: Bodyshop meshing with blender/smd's
let me just get this out of the way that i'am not a very creative person,
so there wont be alot of filler text, just the steps.

today i will be showing you how to edit a body mesh in blender, and link it.
you will need the newest simpe, blender, and my smd import/export script.


here goes nothing... be gentle as it is my first tutorial.

1. export then import in body shop the clothing you want to base your mesh on as if you were just recoloring some clothing.


2. move the new package from savedsims to someplace safe, i made a folder on my desktop.


3. open simpe, create a new package, and click Tools/PJSE/Body Mesh Tool/Extracting stage.


4. click browse.


5. select the package from body shop.


6. you should end up with these 4 files in your new package.


7. click Tools/Object Tools/ Fix Integrity.


8. put a name for your mesh in the box, click update, then ok.


9. save your new mesh package(put "mesh" before the name so you know which it is and is easier to find.)


10. open your body shop package in simpe.


11. select the 3IDR file for the recolor.


12. click Tools/PJSE/Body Mesh Tool/Linking stage.


13. click ok.


14. select your mesh package.


15. click ok.


16. do what it said and goto another file in the package without committing.


17. now save the body shop package.

18. now open the mesh package back up in simpe, and select the gmdc file, and click export.


19. now select .smd as the file format, and hit enter.


20. it will ask if you want to export morph meshes, but we wont be doing that right now as iam showing how to do a simple edit.


Next, the blender side of things.

1. delete the default cube by hitting delete and enter as soon as you enter blender.


2. click File/Import/Sims 2 smd file


3. select the smd file you saved from simpe, hit enter, it will pop up a box asking what you want to import, we want it all, so click ok or hit enter again.


4. zoom down in on the model with the mouse wheel, and right click the sim's body to select it(both the body and bones are selected initially), hit tab to switch to edit mode, and select these vertices's by hitting a to deselect all, then hitting b and drawing a box around them.


now heres where you do the editing, i couldn't think of anything to edit so iam going to give the sim popeye arms. lol
it is possible with smds and blender to make entirely new vertices's or get rid of them(i made a sim made of cubes as a test when i made the exporter), but iam trying to keep the tutorial simple.

5. hit S to scale them, and hold control so you get nice even scale amounts(1.2 vs 1.15599546 etc), and move the mouse till you get 1.3 scale.
[IMG]http://thumbs.modthesims2.com/getimage.php?file=619313]

6. repeat on the other arm. you should end up with something like this.


7. now click File/Export/Sims 2 smd file, but make sure there are no quads, or SimPE will error, you can hit ctrl+t in edit mode with the mesh selected to convert any quads to triangles.


8. name the new smd, and click export.


9. back into the mesh package in simpe... while still on the gmdc, click import this time.


10. select the newly exporter smd.


11. this is where you would specify the new morph meshes too, but trying to be simple we didn't do that this time.


12. select replace from the menu, and click ok.


13. click preview, if all went well you should see the changes.
(note the weird dark spots on the sleeves and bottom of the shirt are from a error in the importer that has been fixed)


14. now copy the bodyshop package, and the mesh package to the downloads folder(i made a folder for them so i knew where they were, to many downloads... lol)


15. at this point, make sure you Moved the body shop package from the savedsims folder and not copied it as i did while writing this(pulled my hair out trying to figure out why my new mesh didnt show up in bodyshop)

16. your done!

(note the weird dark spots on the sleeves and bottom of the shirt are from a error in the importer that has been fixed)
Advertisement
Scholar
#2 Old 12th Sep 2007 at 6:50 PM Last edited by Nouk : 28th Mar 2008 at 8:51 PM.
I'm loving this! Thank you so very much! Now people who can't buy Milskhape can mesh anyway :D

I see the new mesh has some shading along the hem and the sleeve... is it always like that? Does Blender have a tool to fix it?

Please visit WickedNoukFamily Forum for my creations.
Can't take requests, I'm completely swamped with unfinished projects! :O
Lab Assistant
Original Poster
#3 Old 12th Sep 2007 at 11:12 PM
ingame or in the SimPE preview?
Admin of Randomness
retired moderator
#4 Old 13th Sep 2007 at 1:34 AM
Ben, it appears there is a 'normals' issue going on with the hems. That's making the black shading on the hems - and it will appear in game also.

Can you get blender to show the normals (maybe called smoothing) ? It looks like a bit more work/research is needed for body meshes to come in and out normally. But you're so close!

In milkshape - there are smoothing groups. If that part can be worked out so that folks have instructions for what to do to fix it, you'll have a total win.

"Undertake something that is difficult; it will do you good. Unless you try to do something beyond what you have already mastered, you will never grow." - Ronald E. Osborn

Please do NOT PM me with requests, creation questions, or game help questions. Click for help:
Game Help | Create | Content List | Where Can I Find?
Lab Assistant
Original Poster
#5 Old 13th Sep 2007 at 2:50 AM Last edited by Bobcatben : 13th Sep 2007 at 2:51 PM.
fixed it, because the importer wasn't importing normals it was merging 2 vertices on the same spot and ignoring the fact they had different normals, and it wasn't possible for the vertex on the edge of the sleeve to have its normal pointing both for the inside of the sleeve and the outside at once, thus making the problem.

so i updated the importer so it looks at the normals when processing, so there will be some duplicates in places like the sleeves and bottom of the shirt. but it shouldn't hurt. seeing as in smds every faces vertices are duplicates... lol
Admin of Randomness
retired moderator
#6 Old 14th Sep 2007 at 8:48 PM
Ben, great! The meshes definitely had seams along some of the hems. They also had seams running along the side (the uvmapping is different for those places). How are you handling the uvmapping, if I may ask? Can the mapping be adjusted in blender if the mesh shape is changed?

"Undertake something that is difficult; it will do you good. Unless you try to do something beyond what you have already mastered, you will never grow." - Ronald E. Osborn

Please do NOT PM me with requests, creation questions, or game help questions. Click for help:
Game Help | Create | Content List | Where Can I Find?
Lab Assistant
Original Poster
#7 Old 14th Sep 2007 at 9:03 PM Last edited by Bobcatben : 14th Sep 2007 at 9:12 PM.
i just input the uvcoords on a face by face basis in the script, if you mean some automatic way im not sure, i am pretty bad at texturing personally lol.

every face in a smd is 3 lines, separated by a texture name(always map.bmp for sims 2)

each line is a vertex, which has...

<the bone id it belongs to, always 0 for sims 2> <x> <y> <z> <normal x> <normal y> <normal z> <u> <v> <number of bone influences> <bone id> <weight> the last 2 repeat for each bone influence.

in the script i process the list and make 2 unique lists(cant contain any doubles, if you input a double it returns the existing id)

1 of vertex/normals, 1 of texture coords

i make a list of faces at the same time, then dump all the data into blender,
by dumping the vertex/normal list in.
then going threw the list of faces and telling blender which vertices's compose the face, then setting its UV coordinates.
Admin of Randomness
retired moderator
#8 Old 15th Sep 2007 at 12:51 AM
Ben, if it's face by face, then I guess the uvmapping sounds good. (Personally I do not know a lot about the guts of the files, although I know some of how the meshes themselves are constructed) As the issue of the normals and hems came up, that was why I asked. Hopefully someone will be able to give this a good workout now.

PS - now that things are looking good, I've moved this to the tutorials area, and I'm the first to click the thanks button, out of general appreciation

"Undertake something that is difficult; it will do you good. Unless you try to do something beyond what you have already mastered, you will never grow." - Ronald E. Osborn

Please do NOT PM me with requests, creation questions, or game help questions. Click for help:
Game Help | Create | Content List | Where Can I Find?
Lab Assistant
Original Poster
#9 Old 15th Sep 2007 at 1:30 AM
thanks, i didn't know if sims used face uv or vertex uv so i did the uvs on a face by face basis.

i do want to make support for morphs but blender as it is now has no python interface for inputing shape key data(blenders term for morphs), i can get the data tho, so i may make support for morphs in the exporter.
Admin of Randomness
retired moderator
#10 Old 15th Sep 2007 at 11:11 AM
Ben, morphs are already supported by the smd import/export. All a person has to do is say to export with morphs checkmarked, and then import again.

Then they need to make appropriate duplicates of their meshes and save them out as the matching smds (after adjusting the shape for the morph). You should try a simple test (making sure to say pull a vertex to on a morph just so it's really obvious) and then try to import both meshes and see if it works.

"Undertake something that is difficult; it will do you good. Unless you try to do something beyond what you have already mastered, you will never grow." - Ronald E. Osborn

Please do NOT PM me with requests, creation questions, or game help questions. Click for help:
Game Help | Create | Content List | Where Can I Find?
Lab Assistant
Original Poster
#11 Old 15th Sep 2007 at 5:39 PM
i know, what i meant is supported like SimPE supports them internally, where they are actual morphs, then exported as separate smds, but its not really important
Test Subject
#12 Old 19th Sep 2007 at 8:44 PM
i made a new mesh and weightpainted it (which was hard as hell). but now i'm always getting an error that says" 'NoneType' object has no attribute 'id' ".

do you know what i could have made wrong?
Lab Assistant
Original Poster
#13 Old 20th Sep 2007 at 4:41 AM
what line in the export script crashed? the only id related code in it deals with bones, perhaps something is odd with them?
Test Subject
#14 Old 20th Sep 2007 at 10:06 AM
Well I accidentally moved them around and couldn't undo it, so I placed them somewhere near where they were. shouldn't I have done that? if yes, does that mean that I have to do all the weightpainting again?
Lab Assistant
Original Poster
#15 Old 20th Sep 2007 at 2:52 PM
no, moving them shouldn't hurt, as SimPE ignores the bone locations on import(at least on sim bodies), they are just needed for the proper bone weight id's.

maybe email me the .blend(ill pm you my email if you decide to.) and ill take a look.
Lab Assistant
Original Poster
#16 Old 20th Sep 2007 at 9:02 PM
ah, you had a vertex group named "group" with no bone with a matching name, i updated the exporter to check for that now.
Test Subject
#17 Old 20th Sep 2007 at 9:42 PM
ah, okay... i don't know what this means, but thanks anyways! now it is working
Lab Assistant
Original Poster
#18 Old 20th Sep 2007 at 10:31 PM
the script was crashing because there was a vertex group(bone influences use vertex groups named after the bone thats doing the influencing) without a matching bone, so i updated the script to just ignore vertex groups that don't have a matching bone.
Test Subject
#19 Old 21st Sep 2007 at 4:54 PM
sorry if i'm bothering you, but i'm still having problems...
i was able to export my mesh as a .smd file.
when i tried to import it with 3 bones per vertex, SimPE reportet: "Index was out of range. Must be non-negative and less than the size of the collection.
"
so i just importet it with 1 bone per vertex and it showed up perfectly in the preview.
but in bodyshop, the icon is empty and when clicked there's only a floating head without a body.
i'm pretty sure that i followed your tutorial correctly, i did it twice.
Lab Assistant
Original Poster
#20 Old 21st Sep 2007 at 5:04 PM
the blend you sent me for the first problem uses anywhere from 4 to 6 bones per vertex in some places.
Test Subject
#21 Old 21st Sep 2007 at 5:19 PM
so what do i have to do? redoing weightpainting?
Lab Assistant
Original Poster
#22 Old 21st Sep 2007 at 6:06 PM
id hate to say to since i know its hard, i would just manually set vertices's in vertex groups then weight paint to fine tune the balance, not adding any more bones just tuning.
Test Subject
#23 Old 21st Sep 2007 at 7:04 PM Last edited by Nelde : 21st Sep 2007 at 7:23 PM.
ok, thanks. and how exactly do i manually set vertices's in vertex groups? i'm a noob in everything that goes over the standard tools in blender...
Lab Assistant
Original Poster
#24 Old 21st Sep 2007 at 8:06 PM
Test Subject
#25 Old 3rd Oct 2007 at 8:22 PM
it still doesn't work. i'm simply too stupid for this...
i started a new project (with less vertices) but the mesh still doesn't show up in bodyshop or the game.
would it be asked too much if i could send you my .blend file and you would tell me what i made wrong?
Page 1 of 4
Back to top