Unimesh Tutorial #3, Continued
Part 7: Combining Groups into One (Regrouping)
Before exporting this mesh, it needs to have the same amount of groups as it started with, and with the same names and comments.
41) Go to GROUPS tab and click on the 2nd body. Hide and show it, make sure it’s the shoes. Then type in ‘shoes’ next to the RENAME button and hit the RENAME button. Now we have 2 groups – body and shoes.
42) We need to save the comments from the body group. Click on the body group. Click on COMMENT, and a window will pop up with the comments.
43) Select the comments with your mouse and CTRL-C and copy them. Open up a text file and save the comments there just in case. Click OK to close the comments window.
ModelName: body
Opacity: -1
HasTangentArray:
NumSkinWgts: 3
44) Select the entire mesh using MENU – EDIT – SELECT ALL
45) Click on REGROUP. The body and shoes groups will disappear and there will be one group named ‘Regroup01’
46) Now the original settings need to be restored.
Rename ‘Regroup01’ to body by typing in ‘body’ next to the RENAME button and click the button
47) Click COMMENT and paste in the comments you copied, hit OK
You do need to carefully keep track of names and the comments when you’re doing this, but that is all you need to do to combine different groups back into one group.
48) SAVE AS – tut6.ms3d
Part 8: Fix UV Mapping
Now there’s just the one body group. Time to go fix that uvmap where the legs join.
49) MENU – EDIT – SELECT ALL
50) MENU – WINDOW – TEXTURE COORDINATE EDITOR
Now the gap where the leg sections meet is visible. (We created/expanded that gap in Part 6)
51) Zoom in on the gap by typing 3 into the scale box and hitting SCALE.
Hold down CTRL and left click and drag to find the area of the legs with the gap
52) Starting with the lower left leg on the uvmap, one at a time,
Click SELECT, select the lower point, click MOVE and move to align it perfectly with the corresponding point on the upper leg.
53) Repeat this all the way across, using CTRL-left click to move across as needed. Remember that there will be 2 back legs and 2 front legs to fix.
54) When you are done, close the Texture Coordinate Window.
55) SAVE AS tut7.ms3d
Part 9: Export the Mesh and Fix the Texture
56) EXPORT – SIMS2 UNIMESH EXPORTER body1.simpe
(you can quit Milkshape now, but it’s not necessary)
57) Open up your mesh (MESH_tig_tutorial3teenshoes) with
SimPE 58) Replace the gmdc with body1.simpe (click YES)
59) SAVE
60) Quit
SimPE 61) Start BodyShop
Create Parts/Start New Project/Create Clothing
Go to TEEN, Everyday, and look for that dress (with a * on it)
Hey, look at that, she now has high heeled sandals on.
Now these shoes don’t look bad on that shape, but let’s go fix the texture to be the shoes.
62) Click the EXPORT TEXTURES button in BodyShop and name it something like TUT3.
63) Now we need to use our graphics editor and combine the shoes from the TEENHEELS folder we saved way back at the beginning of this tutorial with this dress.
So you must edit
body~stdMatBaseTextureName.bmp
in the teenheels folder and select and copy the entire bottom area (do it all the way across, that makes alignment easy) to get the shoes. Close that file
Open body~stdMatBaseTextureName.bmp in the TUT3 folder, and paste the shoes into the bottom of the texture. Be sure to line the graphic up at the bottom and left and right edges, so that it will be perfectly aligned on your mesh.
64) Now repeat this for the ALPHA file - body~stdMatBaseTextureName_alpha.bmp. Copy the alpha for the shoes from the teenheels folder and paste it into the file in the TUT3 folder.
65) Now click on the REFRESH arrow in BodyShop, and you should see your new shoes.
66) If all is good, give it a name and Click IMPORT TO GAME
67) Quit BodyShop
Part 10: Testing in Game
68) Now is the time to test this mesh in the game. Take it into the game, double check the texture around the feet. Have the sim dance, sit, etc, and zoom in and stare at those lower legs. Pause the game. Move the camera around the sim, checking the lower legs from various angles. Let the sim move a bit and pause it in a new pose, and check again. Do this at least 4-5 times, looking for any signs of a seam or gap or strange animation (like a spike coming out of the leg is probably a bad bone assignment.) Also do make sure to look at the rest of the sim, just to make sure nothing got damaged in the edit by mistake.
I must say this - the animation in the game
is not perfect even with Maxis created meshes. So, if you notice something, like the foot going a bit into the floor, or the leg/foot catching the hem of a long skirt in some of the sim's odder moves - do not immediately stress out. Compare your mesh's behavior to the behavior of the base Maxis mesh(es) you used; dress your sim in the Maxis outfit and try and get the same results. Back out a bit from the super-close zoom of your mesh and ask yourself - does this look normal, or is the error really obvious? You can definitely fix any gaps or seams on your mesh, so if you see them, do go and fix them.
I find having a cheat dresser in the game so I can 'buy' clothing without going to town very handy for the purpose of testing outfits.
Assuming this is all looking good, we’re still not quite done – because we didn’t make a fat morph. But we will.
69) Quit the Sims 2.
Part 11: Make the Fat Morph
We are going to start fresh and import the original mesh we started with in order to get all the parts we need. Then we’ll go get our new mesh and put it in place.
70) Go to Milkshape - MENU – FILE – NEW
71) I’m going to Unimesh Import the gmdc from tfbodysundress
72) This is important – answer YES to ‘create blend groups’
Now there are 2 groups, body and ~00MORPHMOD.0
73) Before going further, click on the body and COMMENTS and copy the comments to a text file
ModelName: body
Opacity: -1
HasTangentArray:
NumSkinWgts: 3
MorphRefNum: 0
74) Copy the comments from the morph group also
MorphNames: botmorphs fatbot
75) Now we’re going to Unimesh import our new changed mesh – body1.simpe (or whatever number you are at, if you found errors to correct) from your tutorial3 work folder.
76) You’ll get a new dialog box – “If you import over another model, results may be unreliable. Do you want to continue?
Click OK
77) Then you’ll get another dialog box – “Do you want to exclude additional bone definitions?” (this prevents another entire skeleton from being added to our project)
Click OK
78) Now we’ve got 3 groups – body, ~00MORPHMOD.0 and body
79) The 2nd body should be highlighted – go copy the comments we just put into a file for body 1 and paste them into the comments for the 2nd body. The difference will be that the last line will now read: MorphRefNum: 0
Click OK
80) Now click on the first body, and click the DELETE button.
81) Click on the body group that’s left (which is our shoes mesh) and click the UP button to move it to the top of the list.
82) SAVE AS – tut8.ms3d
83) Now to make the new morph.
Click on the ~00MORPHMOD.0 and the HIDE button.
You should see your mesh look like it’s become thinner.
84) Now, just to make sure, click on body and then HIDE. Now there should be nothing visible on your screen. Click HIDE again to show the body. Pivot it around, just to double check that it’s got the heels. Yes, good.
85) Click the SELECT button, the mesh will light up red.
86) Menu – EDIT – DUPLICATE SELECTION will cause a new group to appear in your groups window (for me it was ‘Duplicate03’)
Now you have a new copy of the modified body. It’s important to make sure you are editing the duplicate and NOT your original at the same time – so take these extra few steps and save yourself a headache.
87) Click on the Duplicate and HIDE. Click on body and HIDE. The screen should be empty. Then click on Duplicate and HIDE to show your duplicate only.
88) Now you can hide and show the morphmod and the duplicate and adjust the duplicate to be similar to the morphmod. Only use commands like MOVE and SCALE. Do not add or delete vertices, that will make things explode.
The goal is to create a body shape *similar* to the morph, it doesn't have to be exact - but by being close, then as your fat sim changes clothing, they will still look like the same body proportions.
This next part will vary depending on what works for you. You can use the wireframe display or textured display with colored groups, or flip between them.
89) First I actually grabbed the pixels on the chest and used a simple move to pull the out and downward a bit. I was satisfied with that shape once I was done.
90) Then I moved further down the body, pulling a few vertices forward on the stomach to smooth things.
91) Then I selected most of the hips/skirt area, and then I used SCALE with X and Z set to 1.1 (and Y set to 1) using the Center of Mass setting. Then I set X to 1 (so that only Z was 1.1) and I scaled one more time.
92) I then grabbed some pixels here and there to futher smooth the skirt shape. Remember that if 1.1 moves the mesh too much, you can try 1.05.
Make sure to check your mesh with ‘smooth shaded’ as a display from time to time. You want the mesh to have a nice smooth shape, with the vertical and horizontal lines still looking smooth as it distorts; it just has to be similar to the original morph, not a perfect match.
93) Once you have created your new fat morph, it’s time to replace the original.
Copy the comments from ~00MORPHMOD.0 to ‘Duplicate’
Copy the name ~00MORPHMOD.0 and then RENAME Duplicate to ~00MORPHMOD.0
Delete the first ~00MORPHMOD.0
In this step, you need to pay attention to the names and order on the list of your mesh groups. The 'colored group' settings in Milkshape will reassign as you delete or add groups, so you cannot use the colors of the mesh parts to identify the different groups.
Make sure you have the correct groups, you should have exactly 2, and hiding and showing them should be a fit and fat body with the heeled shoes.
94) SAVE AS – tut9.ms3d
Part 12: Testing the Fat Morph and Importing the Final Mesh
95) EXPORT – SIMS2 UNIMESH EXPORTER body2.simpe
(or whatever number you’re up to)
Now we’re going to do a quick test of the fat morph before having to go into the game to test. (Thank you Dr. Pixel for this test) We’re going to clear things and read in the mesh we just saved and see if the fat morph looks great.
96) FILE – NEW
97) IMPORT - SIMS2 UNIMESH IMPORTER body2.simpe
Now you should see 2 groups. Hide and show them. If anything looks exploded, you need to do Part 11 over again.
If you only get one group, body, and it looks fat – that’s because you accidently edited both your body and fat morph together, and since the data was identical no morph was created. Never fear – if you’ve been following directions here, you can still recover your unaltered fit mesh and put it back into place. Rename the 'body' 'morph'. Now import body1.simpe. Remember we saved all those comments and names - good. Move the 'body' up to the top, and paste in the new comments for body from that text file. Now paste the comments for the morph (from the text file) into the morph group. Rename the morph group to be ~00MORPHMOD.0 And EXPORT with a new number. Then test again with Step 96 and the most recent
SimPE file.
No explosion? You see both body and morphmod, and when you hide and show them you can see a difference between fit and fat? Good! Now replace your mesh with this new mesh.
98) Open up your mesh (MESH_tig_tutorial3teenshoes) with
SimPE 99) Replace the gmdc with body2.simpe or whatever the last version is (click YES)
100) SAVE
101) Quit
SimPE Part 13: Fix the Shoe Sounds
We changed these shoes from what look to be flip-flops into high heel shoes. When sims walk in the game, their feet make small sounds, based on the type of shoe the sim is wearing. JM Pescado has posted the codes for fixing the sound to match the shoe!
102) Open the new recolor file we just made from your SAVED SIMS folder – I suggested naming it simply ‘tut3’ - mine was named 7fd17c27_tut3.package, yours will have different numbers at the beginning.
I usually find it easiest to look in my Saved Sims folder and use the view menu to see the directory listing ‘Arrange Icons by.. modified’ Then I just open that file with
SimPE - it will be either at the beginning or end of my directory listing.
103) Find the Property Set (GZPS) and click on it in the left window, then in the right window.
In plugin view, you need to find the value for ‘shoe’
The following values have been identified:
0x00: None - This outfit is a top and has no shoe. Don't use.
0x01: Barefoot - This outfit is barefoot and has no shoe
0x02: Heavy Boot - Heavy stompin' boot.
0x03: Heeled: Some kind of heeled shoe, produces the heel click on walk.
0x04: Normal shoe: Generic ordinary shoe lacking noteworthy characteristics.
0x05: Sandal: Some manner of floppy sandal, found on Maxis sandal-skins.
0x07: Armored: Found on the OFB Knight Armor.
Note that the Armored value might not work for people who don’t own OFB, so be cautious about using that, unless you identify your mesh as only being for OFB – usually meshes we create can be used in all versions of the game.
So now I’m going to look. Indeed, the ‘shoe’ was set to 0x00000005 – the sandals.
104) Click on ‘shoe’, then in the box, change the 5 to 3
105) Click COMMIT and the SAVE
Part 14: Final Test
106) NEVER assume everything is fine. Always test in the game. Double check that everything animates well. Make your sim dance a bit or something and just make sure you didn't accidently move something. Go to CAS and flip between 'fit' and 'fat'. You can also delete any of the earlier recolors that don’t look quite right in CAS.
Woo hoo! Yeah! We made it. Pat yourself on the back. There's a '
Thank You' button at the end of the first message (scroll back up), if you click that it will encourage me to keep writing tutorials.
Tips for Future Projects
Now you’re free to take over the world! Well, at least to start modding meshes like crazy.
Al's Shoes
If you’re using Al’s shoes (available at
http://www.simskins.net/) which import as an OBJ and thus there are no bone assignments, you need to make those bone assignments match a similar Maxis mesh. Start up a second Milkshape and import a Maxis gmdc and look at the bone assignments on that mesh and make the same ones on your new foot/leg/shoe using the Unimesh Bone Assignment tool I showed you in Part 5.
Do NOT use the tutorial provided at simskins, that tutorial is totally outdated and not compatible with the current milkshape/unimesh. Do
not weld anything. Use the bone tools as taught in this tutorial.
Adding Other Parts
If you’re importing some other little OBJ, like a flower or something, make the bone assignments match that of the vertices around the the spot where it meets the mesh. You will need to test these sorts of things carefully in your game (not just BodyShop) and possibly make adjustments.
The obj will need to be uvmapped - it might already have one, although if it does, the uvmap would still need to be moved to an open space on the texture. See
Dr. Pixel's Tutorial for an example of how it's done.
Converting A Mesh or Parts From One Age to Another
Start your mesh by building a mesh file that is the proper age, gender, and type of mesh - full body, or top or bottom.
In Milkshape, start by importing the gmdc that is the proper age/gender/type for your finished project.
Then import any other meshes, parts, etc, without adding any additional bones. (newest unimesh won't even ask, it will do the right thing)
Use the proper age and gender mesh as your guide for scaling down the other parts to fit. If going from teen/adult to child, consider using a child's upper body and adding on the unique mesh parts, so that you don't have to try and properly flatten the chest area. Pay careful attention to the proportions, a straight scale-down of another age mesh often will not look quite right.
You will also probably want to use the hands from a correct age/gender mesh, along with possibly the upper neck.
Make sure the neckline is a perfect match with extended edit, and the same for the waistline if the mesh is a top or bottom only. Or use Wes' new
Vertex Data Merge and Normal Data Merge tools, which make copying that data much quicker.
As usual, when you're done make sure you have the right number of groups with the right names and comments. If you're building something from many pieces, I'd rebuild the fat morph as with tutorial #3.
Bumpmapping
Unimesh supports bumpmaps (has for over a year). The easiest way to have bumpmaps is to use as your base mesh a Maxis mesh that _has bumpmaps_, even if the bodyshape is not what you want.
Make your initial recolor with that mesh, and use that mesh to make your meshfile, and read that mesh into unimesh as your first mesh. THEN read in whatever other mesh or meshes you want to use. Make sure to copy the comments from the original mesh before deleting the groups you don't need.
Alpha Meshes
Alpha meshing is extremely advanced for the most part. I strongly suggest waiting until you are really comfortable editing meshes, meaning you can do them without checking a tutorial, before even trying an alpha mesh edit.
Alpha meshes have multiple groups, similar to hair. Working with alpha meshes is complicated and they simply will not always animate perfectly. That is why almost all the Maxis meshes are not created that way. To get your alpha mesh to look good most of the time often requires a LOT of fiddly work going in and out of the game to adjust things.
You will need a base mesh that has at least 2 groups (and then when you add morphs there will be more than 2 groups, so you will need to look carefully at what you’re editing). The most common meshes people use for the base are the child fairy and teen hula and adult hula. That lets you make alpha meshes for everything but toddlers.
Use the same techniques to replace whatever parts of the meshes with whatever parts you want. You can give it a new body, you can add things to the body (which will alpha to skin). You can give it a new whatever it is where the skirt was. Depending on what you are doing, you might need to line the skirt (see the Milkshape Tips
here - About the ‘insides’) and also look at the uvmapping section. Once your new mesh is in, you'll need to make a new recolor and give the parts appropriate textures.
The steps (in this example using Hula mesh):
Make a mesh with the hula mesh
Import the hula gmdc, save the info about what the groups are named and their comments
Import any other gmdcs you want to use, say like the swimsuit or a dress mesh to replace the body with (do not import more bones)
Replace the 'body' group in the original mesh with a different body -- but be SURE to copy the comments from the original 2 part mesh to your new body group and have it named the same
Delete the original body and move the new 'body' up to its place
In the end, you should have the same number of groups with the same names and comments as you started with.
In order to have your, say, overskirt, animate correctly and move with the rest of the body and not have the underskirt pop through it too often, the overskirt has to have vertices that correspond to the mesh parts below it. Then you can start with making matching bone assignments, and the pelvis area and knees will bend on the outer skirt similar to the inner skirt. After you’ve done these assignments, you will have to go into the game and make the sim walk, sit on a chair, sit on a couch, and start adjusting things, by either changing bone assignments or moving the vertices. Then go back and make the sim dance and jump on a couch. You will want to minimize the quirks in the display that will happen from time to time, so that most of the time the sim in game animates well, and limbs aren’t popping through your alpha skirt. It’s one thing to have an occasional bad display during a dance move, but another to have it there the frequently when they’re sitting on the couch talking or walking around.
Tig's thoughts/experiences/comments on alpha meshes:
Generally simply trying to layer, say, and entire tight skirt or pants over a body mesh will produce a mesh that will have frequent 'bleed throughs' of the body mesh as the sim sits, dances, etc - this is due to how the vertices deform with the skeleton to animate - even if you match the vertices and bone assignments exactly, if they are too close together it's likely that you'll get some bleed-through. So only use alphas where they are most needed, and preferably not tight against the body. Even with all that effort (trying to align vertices, making the values the same) you will probably have to go in and out of your game alot and experiment with small changes to make your alpha behave well. I spent as much time (if not more) fiddling with my alpha loincloths as I did initially constructing their meshes.
Alpha meshes also usually have more vertices, and use 2x as many graphics, and thus are more of a demand on people's games. So don't make an alpha mesh unless you need an effect that you cannot get any other way - two meshes for shorts that are of different lengths will actually animate better and be easier to recolor and so on, compared to one alpha mesh to create variable length shorts.
Good luck on your future meshing adventures!