Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Scholar
Original Poster
#1 Old 13th Feb 2005 at 2:48 PM
Default [Tutorial] Using MilkShape for Object Meshes
Using Milkshape for Sims Objects

This thread is about using MilkShape to edit 3d objects for the Sims game - it does NOT apply to editing body or hair meshes. I will be using MilkShape and LithUnwrap because those are the ONLY 3d programs I have, and the only ones I know how to use. PLEASE don't ask me "how would I do that in 3d Max (or other 3d program) - the answer is, I haven't a clue.

The object I am making here is shown in the attached picture. I will be both altering the shape of the original Maxis mesh, and adding some new parts.
I will also show you how to do the texture-mapping.

Before we start you'll need a few things:

1} The SimPE program - make sure you have the very latest release - http://sims.ambertation.de/
2) The mesh importing tool http://meshtool.modthesims2.com/
3) MilkShape - http://www.swissquake.ch/chumbalum-soft/
* You {may} also need the Mesa.dll's which can be downloaded from the MilkShape main page
* It won't hurt to grab them while you are there
4) LithunWrap - http://files.seriouszone.com/download.php?fileid=198
5) A graphics editor for making the textures
6) A bit of experience making either object recolours or skins

MilkShape is the only one that is not free - it is shareware ($25 US or 25 Euro) but the trial version is fully working for 30 days. And compared to other 3d programs, it is a real bargain.
If MilkShape acts funny (random crashes, undo not working, or other odd glitches) unzip those Mesa.dll's and put them into the same folder where MilkShape is installed.
Screenshots
Advertisement
Scholar
Original Poster
#2 Old 13th Feb 2005 at 3:04 PM
Default Extracting the needed files from the game
The first step is to use SimPE and the mesh extractor plug-in to extract from the game the "base" object that you are going to use.

For this tutorial, I am using my BoomBox, which started out from the Maxis small boombox in the game.

Find the boombox in Object Workshop (it's name is "Compact Stereo by Lo-Fi audio")
If you just start typing "compact" in the top box it will find it before you get to "p"

Just follow the tutorial here http://meshtool.modthesims2.com/ on getting the original object cloned, and extracting the mesh into an .obj file we can load into MilkShape.

But don't close SimPE after making the cloned .package file, and exporting the .obj file -

First, click on Texture Image in the filetypes section
You will see two files listed now - check both in the PluginView tab
One is the alpha mask for the object's shadow, which we don't need
The other is the actual texture for the object, that's the one we want
Click on the largest size, then export this into your folder
<see the pic>

We are now finished with SimPE, you can close it.

Then, using your graphics editor, convert the .png image that was exported into a .bmp, and save that in your folder too.

In your folder, you should now have:
a .package file
an .obj file
a .png image
a .bmp image
Screenshots
Scholar
Original Poster
#3 Old 13th Feb 2005 at 3:14 PM Last edited by Dr Pixel : 15th Feb 2005 at 3:42 PM.
Default Editing the original mesh
If you have never MilkShape before, here are a few tips:

First, go to the Windows menu, and un-check "Show Keyframer"
It's used for creating animations, and it is of no use to us

I DO check "Viewport Captions" - this will put the titles above the 4 windows - makes it easier to stay orientated.

Now on the File menu, choose "Import/Wavefront Obj..."
Then go to your work folder and click on the .obj file you exported

Next, look at <pic 5>
This shows the meaning of the 3 co-ordinates used in 3d
x = left right (as seen from the front)
y = up/down (again looking from the front
z = foward/backward (from the front)

You can also see the first annoyance - the object exporter exports our object laying down on it's back. There is nothing we can do about this, we'll just have to deal with it. Do NOT ever rotate or move the object from it's original position to try to make it easier to work on, because unless you get it back into the same exact position when you are finished it's going to be useless in the game.

Good news! I figured out how to easily get the mesh into the right position, and how to correctly get it back into the original position when you are all done -

See this post, it makes things much easier: http://modthesims2.com/showpost.php...40&postcount=12

You can click in the 3d view window, and move the object around to whatever position you want (like in BodyShop), but leave it be in the other windows.

Now we will put the texture onto our object. Go to the Groups tab
You will see a list of all the texture groups - in this case there are two, the boombox itself, and the groundshadow (that flat rectangle at the bottom) We don't want the groundshadow right now, so click on it's name and then click the "hide" button

It disappears from the screen. Now, click on the the boombox group. Then click the Select button

The whole boombox should turn red, to show it is selected. Click the "Material" tab

You will see a white ball in the middle, and beneath it are two long buttons with <none> on them

Toward the bottom, first click the "New" button - in the list at the top there will now be a line that says "Material01"
Now, click the upper of the <none> buttons. It will open a Choose File window. Select the .bmp version of your texture and open it. The ball will turn coloured - the bmp is being wrapped around it. You can click and drag it around to see, if you like. When you're done playing with the ball, click the "assign" button.
If it looks like nothing happened, Right-Click on the 3d window, and make sure "textured" is ticked.

Your 3d preview should now look like the original boombox.

Now, we can start editing. The first thing I want to do is get rid of the handle.
Go to the first tab, "Model", and click the "Select" button. You will see the Select Options show at the bottom.
Select Vertices there, and make sure "hide backfaces" is NOT checked.

For those unfamiliar, a 3d mesh is made up of "faces" and "vertices". The faces are those triangles, upon which your texture will be shown. The vertices are the corner points of the triangles.

The whole truth is the correct name for the triangles is "polygons" because some 3d programs can use 4 sided (or more) faces. But the Sims game, and MilkShape, only use the 3 - sided triangles. Anyway, MilkShape calls 'em "faces", and so will I.

So, we are now in "select" mode. To select the vertices, we drag a box around them with the left mouse button.
To add to the selection, hold down [shift] while dragging another box. To un-select unwanted vertices, hold down shift while dragging a box with your RIGHT button.

Oh, I forgot to mention how to zoom in and out - first make sure you are NOT in select mode. If the select options are showing, you ARE in select mode. Just click the Select button again to get out of select mode.
Then, hold down [shift] and drag your mouse up/down in any window to zoom in/out. Also, hold [ctrl] and click/drag to change the view in the window.

Back to what we were doing - get back into "select" mode, and select all the vertices of the handle <pic 6>

Now, on the Edit menu, choose Delete Selection

Wo! The handle is gone! But, if you look in the 3d view you'll see that now there are a couple of ugly holes where our handle used to be We're going to have to fix those. <pic 7>

So, next I select the vertices around one of the holes. To make it easier, I first right-click in the 3d preview window and checkmark "wireframe overlay"
This puts the image of the "wireframe" (just another name for our mesh) on top of the 3d view. Now, we can rotate it around after selecting vertices or faces to be sure we have selected the ones we want. The selected vertices will also turn red on the 3d view.

Once I have the correct ones selected, I go to the Vertex menu, and choose Snap Together. This brings all the selected vertices together on top of each other.
And then, Vertex/Weld Together. This will turn all those separate vertices into one. Like magic, the hole is gone.
<pic 9>
Repeat this on the other side.
Screenshots
Scholar
Original Poster
#4 Old 13th Feb 2005 at 3:26 PM
Default Editing the original object (2)
Now we're going to get rid of the original speakers by smooshing them in towards the center.

Select all the vertices on one side <pic 10>

Then, select Scale

The scale options will appear. We want to "shrink" the sides in only in the "x" direction (left/right in our "front" window) so I type in .9 in the box above "x", and leave y and z set to 1

These are percentages, so less than 1 will shrink the parts, more than one will expand them. Usually, .9 and 1.1 are all I use but if you are brave you could try bigger numbers.

If you go too far, just use the Undo feature to go back.

I click the Scale button at the bottom. Each time I click, the vertices are scaled to 90% of their former size. They aren't really moving toward the center, they are really squishing down amomg themselves, but that's what we want. When it looks about right <pic 11> I switch to "move" mode

In the Move options, we want to make sure we are moving only in the "x" direction, so I lock out Y and Z by clicking on the first, then I left-click/drag the side to where I want it <pic 12>

Repeat on the other side It should look like <pic 13> when you are done
Screenshots
Scholar
Original Poster
#5 Old 13th Feb 2005 at 3:33 PM
Default Creating New Parts
This part deals with making some new speakers using the built-in shapes in MilkShape. The correct name for these is "primitaves", and MilkShape has 3 The box, the sphere, and the cylinder.

"Big deal, that's not much, I can't make anything out of those but balls and sticks", you say.

Not true, you could also make a box to put them in

Seriously, you can make just about anything using these shapes as a starting point.

I first select "sphere" on the model tab, then I use the mouse to "draw" my sphere in the approximate loaction and size that I want it. <pic 14>

I go to the groups tab, and I see a new entry is on the list, named "sphere01"
I rename this as "speaker". I always rename new parts right away, it will avoid a lot of confusion later - trust me

The back is going to be a bullet-shaped case for the speaker, the front will become the speaker grille. We are going to have to texture-map these as two different groups, so they can be put in different locations on the texture map. To do that, I go to "select", and set it to "face" and checkmark "by vertex"

Then I select only the back part of my sphere. I then go to the "groups" tab, and click the "regroup" button.
<pic 15>

A new entry will appear on the list, named "regroup1". I rename this "speaker back"

Next, back to the "model" tab and I click "select" and "vertex"

I lost a few pics, so I can't show you the whole operation, but what I do is to select each "ring" of the front part of the sphere, one at a time, and move it down flush with the front of my new "speaker"

When it's done, it will look like <pic 16>
Screenshots
Scholar
Original Poster
#6 Old 13th Feb 2005 at 3:45 PM
Default Making New Parts (2)
The speaker looks ok for now - but it will need a stand so it isn't floating in mid air like that.

I'm going to make the base first.

I make another sphere, a bit smaller than the first one. I "draw" it off a ways from the rest of the mesh at first, to make it easier to select parts of it without having to hide the rest of the mesh.

Don't worry if you make your parts too big or small at first, you can resize them with the "scale" feature, like we did with the radio itself earlier.

I want the base to be flat on the bottom. I could flatten out the bottom of the sphere like we did with the front of the speaker, but for the speaker stand it is never going to be seen, so I'm going to simply cut it off. This is better because it gets rid of a lot of wasted vertices. It's very important, for game meshes like these, to keep the amount of polygons (faces) as low as possible, because the more polygons your mesh has, the more strain it is going to put on the game. The key to a good game mesh (as opposed to a good mesh for rendering) is to put as much of the detail on with the texture as you can, and only put details onto the actual mesh that can not be effectively drawn on with the texture. For example, instead of making an actual "mesh" to go over the speaker with a load of tiny cylinders, instead I made the face of the speaker flat and will draw the "wires" on the texture. This saves a LOT of polys, and no one is ever going to notice.

I select the vertices at the bottom of my sphere <pic 17> and then on the Edit Menu, I chose "Delete Selection"

Now, I move my new half-a-sphere into position with the bottom of it even with the "groundshadow" or slightly below it. <pic 18>

It's too "humpy" looking, so I use "scale" to flatten it down until it looks right. Then I go to the groups tab, and rename it "speaker base".

Yes, I know - you're thinking "I don't need to do all this renaming, I'll remember that sphere02 is the speaker base".

Did you ever make a CD and not write down the names of the songs? Because you knew you would remember what songs were "track1, track2" ? Me too. And I never remember either

Keep in mind, you may want to come back to this mesh 2 months from now to change something, or steal a part to use on a different mesh.

Next, we need a column to go up from the base to support the speaker. So, I make a cylinder. I set the stacks (this is how many sections high) to 2 and the slices (the sections around) to 8. I also uncheck "close cylinder"
Close cylinder would finish off the top and bottom of the cylinder, but the top and bottom are going to be hidden inside the base and speaker, so we don't need them here (low poly, remember?) Then I drag out a cylinder of about the right size <pic 19>

I click the [Rotate] button, and in the "Left" view window, I drag it around to the correct rotation.

I then click [Move] and move it into position, and use scale only on the bottom vertices to make the stem a bit more tapered looking.
Screenshots
Scholar
Original Poster
#7 Old 13th Feb 2005 at 3:59 PM
Default Basic Texture Mapping
The next thing we want to do is some basic texture mapping. Texture mapping shows the game where each face of your mesh will get it's image from your texture image.

Yes, I know we need another speaker too - but it will be much easier if we get all the texture mapping done first.

Then we only need to make a second copy of the finished speaker and stick it on the other side.

If we do that now, we are going to have to texture map each speaker separately, which is a waste of time.

I go to the "groups" tab, and in turn click on each part, then click on Select (except the groundshadow)

Your whole mesh should now be red. If any parts are not, click on them, and Select again

Now to the materials tab, and click Assign. Everything in the 3d window should now have the texture on it, although it will look weird because some of it is in the wrong places.

Then we use the Window menu to open the Texture CoOrdinate Editor window

It shows the texture image, but it doesn't look like anything is on it.

Make sure the drop-down list right below the "Region" button says Stereoboombox.

Drag the bottom of the window down, and you will see that the texture map for the main boombox is displaced below the actual image. This is something in the exporter I think, but it's easy to correct <pic 20>

The vertices should already show as selected, but if not click the Select button and drag a box around the whole thing.

Then click the "move" button, and drag the texture map up to where it should be. You can checkmark the "redraw" option, and view your progress in the 3d preview window. <pic 21>

What we are going to do, eventually, is to "flip" over the front part of the boombox's texture map to mirror the one side of the image onto both sides.

That will leave us space on the left, and on that unused black area at the right where the handle once was, for our new parts.

We can't do the actual "flipping" here (MilkShape's texture mapper is very limited) but it will be helpful to get a basic texture mapping done here before we go to LithUnwrap

If you click on the speaker front in the drop-down list, you will see that it is mapped out all in a rectangle at the top. That's not going to work, I want it mapped from a front-on view.

So, I click "Region", and drag a box where I want it mapped. < pic 22>

Since the whole boombox is laying on it's back, the "front" is what MilkShape considers the "top", so I choose "top" in the lower drop-down list, and click "remap"
<pic 23>

I do the same for the speaker back, base, and stem. But for these, I draw the region box first before changing the drop-down list to their name, because that lets me use the previous part's texture map as a reference.

Don't worry about getting them exactly right here, just make sure they are all on the actual image somewhere.

We will be doing the final texture-mapping in LithUnwrap, so save it as a .ms3d file and close MilkShape
Screenshots
Scholar
Original Poster
#8 Old 13th Feb 2005 at 4:04 PM
Default Texture Mapping in Lithunwrap
To get your new object into LithUnwrap so you can texture-map it, use the File menu - Model/Open

Select your .ms3d file, and you will see the texture image, with all your texture groups shown at once.

The first thing we need to do is to flip over the left "speaker" area onto the right to give us space for our new parts - but that would be impossible with all that stuff overlapping.

So, I use the Groups menu/Hide and choose to hide all the groups except the original boombox <pic 24>
Click "apply" first, and your other groups will disappear. Then close the window.

Then go to the Select menu, and make sure Face is checkmarked
Now drag a box to select the faces of the left speaker area <pic 25>
I should point out that in LithunWrap you do all the selecting/unselecting with the left button.
To add to the selection, hold down the [shift] key. To remove from the selection, hold the [ctrl] key

Next, go to the Edit menu, and choose Flip/Horizontal
Your selection should be flipped, as in <pic 26>

Click on any of the selected vertices, and drag the whole selection over until it overlaps the right side as closely as possible <pic 27>
Screenshots
Scholar
Original Poster
#9 Old 13th Feb 2005 at 4:10 PM
Default Texture mapping in LithunWrap (2)
Now you want to re-select the entire right-hand "speaker" area, so the vertices below the ones we just moved are all selected too <pic 5>

Then, on the Edit menu, choose Weld

You will see a small window with the Weld options - the default setting is fine, just OK it
OK the results window too <pic 28>

That's it for the main section, we now have the room for our other parts without anything overlapping.

We need to make sure our other groups are correctly positioned, but that's fairly easy now.

On the Groups menu, I choose Unhide, then select the first part - the SpeakerFace and unhide it

On the Select menu, I set it to Group. This means that I now can drag a box on any part of a group, and the whole group will be selected - very handy when things are overlapping a bit. I select the SpeakerFace group <pic 29>

On the Edit menu, I select Scale/Free. The box surrounding the group turns green, and I can now resize the whole group by clicking and dragging on one of the green boxes at the corners. <pic 30> Resize it as you like, when you are done click anywhere EXCEPT the green corner boxes to get out of Scale - the whole group will be red again. Click on any of it's vertices and slide it into position. <pic 30>

Keep repeating this procedure for each of the other parts except the Groundshadow, until you have them all where you want them.

<pic 32>

We don't need to texture-map the groundshadow, it doesn't use the texture at all. The game uses it to know where to place shadows.

When it's all set, use the File menu Model/Save and save it, making sure you have selected .ms3d as the filetype on the Save window.

We also will save a UV_map image, to use in our graphics editor while working on the texture itself.

On the File menu, choose UV map/Save

You will get a Save File window first - pick a name (I used "Boombox_UV") and ok it.

An Options window will open. I picked Black and White, and set the size the same as the original texture's size, and OK it.

We're done with LithunWrap for now, so you can close it.
Screenshots
Scholar
Original Poster
#10 Old 13th Feb 2005 at 4:27 PM
Default Final steps in MilkShape
We're almost done.

Now we go back to MilkShape.

This time we use File/Open to open up our newly texture mapped .ms3d file

We still need another speaker, so we go to the Groups tab, and click on each group of the speaker and select it - the whole speaker should be red, and nothing else.

Then, on the Edit menu, choose Duplicate Selection
Huh? Nothing happened! Yes, it did - look on the Groups listing. A new group was added. It's sitting right on top of the original parts right now, so we don't see it, but it's there.
Rename it "Speaker2" <pic 35>

Now click on the Model tab, then click Move and lock out "y" and "z". Then drag the new speaker over to the other side - See, I told you it was there <pic 36>

Save now, as a .ms3d file (just in case you want it in the future)

One final step - our original object had only 2 groups, the groundshadow and the boombox.

We want to combine all our groups, except the groundshadow, back into one - this will make it easier to re-import our new object into the game. And easy is the name of the game, it's already complicated enough....

Back to the groups tab, this time select everything except the groundshadow.

Make sure it is all red - then click Regroup

Now rename it back to the original name (stereoboombox_design, if you forgot) <pic 38>

We're done with MilkShape - use File/Export/Wavefront.obj and save it back into your work folder.

Some people have asked me how to get the new texture-map into their .package file - you just did! MilkShape puts it into the .obj file when you export, and the mesh tool will put it correctly back into your .package file.

The UV map image (.bmp) that we saved is just to help you out with your texture image.
Screenshots
Scholar
Original Poster
#11 Old 13th Feb 2005 at 4:38 PM Last edited by Dr Pixel : 13th Feb 2005 at 4:42 PM.
Default Making the texture image
One last thing, before using the Mesh Import tool to get this into the game

We need to make the texture.

This is done just like making a clothing skin in BodyShop, or an object recolour.

I open up the original Maxis texture, and the UVmap image we saved before in my graphics editor

I use the UVmap as a layer above the original Maxis image, and fade it out until I can just barely see it. Then I draw my new texture below it. <pic 40>

I use Lithunwrap's 3d preview window to view it as I go.

Just start Lithunwrap, load up the .ms3d file again (the final version, with all the parts on it) and choose Preview/Show Model on the menu.

To reload your pic, save it from your graphics program as a .bmp, then in LithUnwrap, on the Material menu - choose "Modify"
Then click on the Maps tab, then Properties, and finally Reload

It's a bit awkward, but you do get a nice preview to make sure everything went as planned.

Once your texture image looks right, make sure you remove the UV map layer, and then save it as a .png image.

That's it, you now can use the Mesh Import tool to get your new object back into the game.

Make sure you use the section for putting a NEW mesh into the game.

Don't worry about the part where it says to export the texture and edit it, we have already done that. Just skip ahead to putting the image backk into the file.


I've attached a pic of my finished texture image - you can see I mainly "blanked out" the speaker image on the right side, and drew in the new parts where needed.

I hope this gets you started - feel free to ask any questions about anything you don't understand.

You can get the BoomBox object itself here:

http://modthesims2.com/showthread.php?t=42949
Screenshots
Scholar
Original Poster
#12 Old 15th Feb 2005 at 3:40 PM
Default Important Update
Good news - I just figured out how you can safely get your object into the proper rotation in MilkSjhape - it makes all the editing MUCH easier

Here's how:

As soon as you import your .obj file for the first time, do this:

1} On the menu, choose "Edit/Select All"
2} Click the [Rotate] button
3) Type in the "z" section 90 in place of the 0
4) Click the [Rotate] button that is right beside it
5) Leave "z" at 90, and type 90 into the "y" section as well
6) Click [Rotate] again - your object will now be facing correctly, the Front Window will show the front, etc.

Now do all your editing, texture mapping, and all the rest - you can save as a .ms3d file whenever you like.

But, at the very end, when you are all finished and ready to export the final .obj file:

Make sure ALL your groups are showing by using "Edit/Unhaide All"
Then "Edit/Select All"

1) Go to Rotate again.
2) Set x = 0, y = 0, and z = -90
3) Click [Rotate]
4) Set x = 0, y = -90, z = -90
5) Click [Rotate]

Now your mesh is back in that same awkward position the way it came in, and it is safe to Export it to an .obj file to put back in your game.
Guest
#13 Old 2nd Mar 2005 at 4:29 PM
Oncw i export how do i get it into a .package file?
Test Subject
#14 Old 3rd Apr 2005 at 5:45 AM
Default Disapperaing Faces
Hello, I've been trying to get this mesh to look right in Bodyshop. I'm using Milkshape and Lithunwrap, but I seem to be getting disappearing parts in my mesh (see the attached pics). The parts that look darker in Milkshape aren't showing up in Bodyshop. I tried reversing the vertex order and pressing the "face front" button, but nothing seems to work. By the way, I'm using the Mesh tool and exporting/importing SMD files. Any advice would be much appreciated. Thanks.
Screenshots
Scholar
Original Poster
#15 Old 3rd Apr 2005 at 8:25 AM Last edited by Dr Pixel : 3rd Apr 2005 at 8:29 AM.
It's kind of hard to tell from your picture because it looks like you used black on your image too.

Look at it in MilkShape with no texture on it - any areas that are solid black will be invisible in the game.

That is caused by reversed faces - Faces are one-way only, the front side will show the texture, the back side will show nothing (invisible)

If you are making the wings by drawing vertices, and then connecting them into faces, you have to be careful to always connect them in the same direction

To fix it, you have to select only the faces that are black, and reverse the vertex order on them.

Then you will have a set of wings that are visible from one side - to make the other side visible, select the whole thing on the Groups tab, then duplicate the selection. Hide the original, and do a reverse vertex order on the whole duplicate set of wings - the opposite side should turn all black.

Then unhide the other part, and position them correctly so that both sides show up with no black showing.
Test Subject
#16 Old 3rd Apr 2005 at 6:35 PM
Thanks for your help. I rebuilt my wings and got them all facing one way.
For some reason, Reverse Vertex Order does absolutely NOTHING when I click it. I'm sure I have the right things selected, but it doesn't do anything. Any ideas?
Test Subject
#17 Old 3rd Apr 2005 at 6:55 PM
Never mind, I got it working now. Apparently, you have to unselect the model for it to take effect. Thanks again for all your help. :D
Lab Assistant
#18 Old 6th Apr 2005 at 10:42 PM
Default Help
Hi,
I'd like to know how to create a hole in an object, using mikshape. I 've made this crib, and i'd like to moke a round hole in it. See image. Thanks if you can help
Nat
Screenshots
Lab Assistant
#19 Old 22nd Apr 2005 at 12:02 AM
Hi!
Can you post how to create a hole in an object? I think it´s very interesting for some creators - me too...

Thanks
Lucifer´s Angel
Back to top