Replies: 90 (Who?), Viewed: 84638 times.
Page 1 of 4
Ms. Byte
Original Poster
#1 Old 5th Dec 2009 at 2:47 AM Last edited by CmarNYC : 26th May 2010 at 3:30 AM.
Default Tutorial: Adding a pregnant morph (and more)
** Please note I've posted a more complete and improved tutorial on this subject in the "Clothing Meshing for Dummies" thread, including a solution for the problem of CC maternity wear not being used in the game:

What this tutorial will do:

Show you how to add a pregnant morph to clothing using Milkshape and BodyMorphMaker.

Show you how to use the same technique to modify the other morphs for new clothing meshes as long as their vertices are numbered properly and exactly the same for the base mesh and the morph mesh.

What this will not do:

Teach you how to use Milkshape or any other meshing tool.

Teach you how to add morphs in more complex circumstances such as Frankensteined meshes or entirely new meshes without the proper vertex numbering. I'll make a future tutorial on those situations once I've had a chance to figure out how to do it!

What you'll need:

Milkshape with Wes's plugins or another meshing tool that can export morphs: (make sure you have the latest version)

BodyMorphMaker, available here: (again, get the latest version)

CAS Texture Unitool (CTU), available here:

Postal, s3pe, Sims3PackageExplorer, or any tool to search, extract from, and import into package files.


The basics of morphs are fairly straightforward. The CAS part file contains flags defining the age group and gender for the clothing, the category or categories such as Everyday, Sleep, etc., and a set of links pointing to the meshes that define the shape. It also has links to bodyblend files for the four game morphs: fat, fit, thin, and special (pregnant). The bodyblend files have a few more flags and a link to a BGEO file which contains the morph data - coordinates describing how to move the mesh vertices for each morph. The BGEO data is a compressed form of the information in the morph meshes for each morphed shape. Every clothing mesh in the game for teens to elder have a bodyblend and a BGEO for the special morph, including the ones for males, but for clothing that has no pregnant morph the BGEO files have no data.

I'll demonstrate adding a pregnant morph, a task that's not at all difficult even for my beginner's meshing skills. Except for the actual meshing and the modification of the CAS part category, the same steps apply for any of the morphs.

Step 1. First, find and extract the mesh for the clothing you want to add the pregnant morph to. In this case I'm going to use CTU to extract the tfBodyShirtLong mesh. As long as you're here, also click on the Parts Category tab and tick off "Valid for Maternity" in the Extended Category box. (Note that in order to work, maternity clothing also has to have "Valid for Random" checked.) Click the Apply button and save the package with an appropriate name. Using your favorite package explorer, open the package you just created and extract the CAS part file. (In s3pe, Resource/Export/To file)

(See screenshot 1 below)

Step 2. To make the morph, import the clothing mesh into Milkshape, then go to the Group tab and hide it. Import it again over itself as a second group, open the comments for that second group, and change them to:

FVFItems: 3
TableType: 0
References: 1
TGIRef00: 00000000 00000000 00000000 00000000

This tells Wes's export plugin to export that group as a morph mesh. You need the first group because the exporter needs to calculate the difference between the original and changed positions of the vertices.

Modify lod1 of your mesh by pulling the vertices of the stomach into a pregnant shape. (If you're only doing this as an exercise, don't get too involved in making it perfect.) Keep in mind that what you want is the fully pregnant belly - the game will phase the morph in as the pregnancy advances. Be sure NOT to change the original mesh you imported first - that's why I told you to hide it. When you're done, do the export. Skip the first group (Geom 00) and save the second group (Geom 01) - that's your morph. It's a good idea to save it as a separate file and keep the original mesh - if you want to make changes later you'll need to import the original mesh (and hide it) and then the morph on top of it.

If you want to do a complete job, do the same morph for lod2 and lod3 as well. They are less detailed and are used in the game when the view is zoomed out. For any clothing mod that's going to be uploaded, all the lods should be done since anyone playing using low Sim detail will definitely see them. You don't have to be very careful with lod3, which will only be seen from a distance, and in fact it has so few vertices that it's going to look lumpy no matter what you do.

(See screenshot 2 below)

Step 3. Now, start BodyMorphMaker.

Give a descriptive name for your morph, this case I'll use "tfTShirtLong_special". For LOD1, LOD2, and LOD3, use the 'Select File' buttons to browse for your three morphed meshes. Note that the extra spaces in each lod are for clothing that has more than one mesh per lod. You should enter them in order: lod1, lod1_1, lod1_2, etc.

(See screenshot 3 below)

The Instance ID is a little more complicated and involves two possibilities.

Case 1 - If you're adding a pregnant morph to game clothing, as we are, it's easiest to use the Instance ID that is already in the game. Remember that clothing that doesn't have a pregnant morph has a bodyblend and an empty BGEO; replace the BGEO file with your new one and you have your pregnant morph. There are a couple of ways to get the instance ID. In this case probably the easiest is to click the 'Edit CAS part file' button in BodyMorphMaker and open the CAS part file you extracted from the package CTU made. Copy the instance number (the number after 'I:') for the Special morph and paste it into the project instance ID. (The same instance ID is used for the bodyblend and the BGEO.) Do NOT click the 'Link to project bodyblend' button.

(See screenshot 4 below)

Another way is to look at the clothing in CTU - in the Part Details tab you'll see 'TGI Index Blend Info Fat', repeated for each morph, with a number. If you look for that number in the TGI list, you'll find the link to the bodyblend (bblend) file, and the instance is the last hexadecimal number in the key.

Case 2 - If you're making new, non-replacement clothing and want to add a pregnant morph that doesn't affect the original game clothing, you'll have to generate a new bodyblend and a new BGEO, and modify the CAS part file to link to them. Use the 'FNV hash' function in the BodyMorphMaker menu bar and enter a unique descriptive name for your morph - this can be the same morph name you used before as long as it's not the same as the original game clothing name. It will generate a new instance ID for you to use, which you can easily copy to the project instance ID by clicking the Copy button. Then click the 'Edit CAS part file' button and click on the 'Link to project bodyblend' button for the 'Special' morph, and save. This will give you a CAS part file linked to your new bodyblend and BGEO.

Speaking of which, now click the "Create BGEO" button at the bottom. The BGEO file it produces contains the morph mesh information for all three lods. If you need a new bodyblend file for new clothing, click on "Create Blend". This will make a bodyblend file which links the CAS part to the BGEO file.

It's a good idea to save your project to save having to enter all this again if you need to tweak your morphs. The save option is under 'File' in the menu bar.

Close BodyMorphMaker and on to the last step.

Step 4. In this case, since we're doing an added pregnant morph for game clothing, all we need is the BGEO file you made in the previous step and the CAS part file that classifies it as valid for maternity. Use a package explorer to import them both into a new package. (You could try using the package made by CTU but I've had problems with the instance IDs being changed when I import into them, and they won't work for me.) Put the package into your game and the pregnant morph should work.

(See screenshot 5 below - not the best meshing in the world, but that's not the point of this tutorial. )

So, to sum up:

If you're adding a pregnant morph to existing game clothing, you need a new BGEO file which will override the game BGEO file and a modified CAS part file to enable it for maternity.

If you're adding a pregnant (or any other) morph to new non-replacement clothing, you need a new BGEO file, a new bodyblend file, and a new CAS part file that enables it for maternity (if necessary) and links to your bodyblend.

A note about VPXY files and the Group ID:

VPXY files are collections of pointers to other files; in the case of clothing they point to meshes. The game files include VPXYs and morph meshes for all the morphs in the game, but they appear not to be used. As far as I know, including them in your package is entirely optional. If you do want to create a VPXY, BodyMorphMaker will do it. You'll need the group ID of the clothing and will have to assign appropriate instance IDs as well as the group ID to your morph meshes. The usual practice is to use an FNV64 hash of your clothing name with the morph name and the lod, for example: cmar_tf_BodyShirtLong_special-lod1, etc. for each lod. If the meshes are named in TGI format, BodyMorphMaker will find the TGIs automatically.

And a few notes about changing or replacing the other morphs:

First, be sure you even need to make a new morph. If you've made new clothing by taking a game mesh and modifying it, as long as you haven't added or removed vertices or changed the vertex numbering or made really drastic changes in the shape, you probably can use the existing game morphs. The morphs consist of how the vertices should be moved to make the body fat, fit, thin, or pregnant - since they will move in the same direction relative to their position as for the original mesh, in most cases it will still work for your changed mesh. This is how CTU makes new non-replacement clothing with working morphs - it links it to the bodyblends and BGEOs for the original mesh.

If you do decide you need to modify the morph meshes and make a new BGEO, the procedure is basically the same as above. You would generate a new instance ID from a descriptive name, create your new bodyblend and BGEO, and link them from the new clothing CAS part file CTU created for you.

For the slightly more advanced mesher, Base1980 has written a tutorial on how to make a pregnant mesh by copying vertex information from a game morph:

Good luck and happy morphing!
3 users say thanks for this. (Who?)
#2 Old 5th Dec 2009 at 12:11 PM
#3 Old 10th Dec 2009 at 7:49 PM
Thanks for this tutorial!
I have a question, the comments have to be the ones to all or varies according to what we are doing?
#4 Old 11th Dec 2009 at 5:50 AM
The comments are used instead of requiring the user to check a bunch of options on a screen for export, and some are to allow data to flow from the import to the export, where it doesn't fit into the model MikShape uses.

Leave the comments alone for the "base" group.
Make the comments exactly like Cmar shows for the "morph" group.

No other modifications to comments need to be made, except as advanced modding work (changing material type or bumpmap) by expert meshers.

If you like to say what you think, be sure you know which to do first.
#5 Old 11th Dec 2009 at 10:05 AM
#6 Old 11th Dec 2009 at 11:07 AM
When I click in the 'Edit CAS part file' button what I have to open?
Ms. Byte
Original Poster
#7 Old 11th Dec 2009 at 12:47 PM
A CAS part file should be in the package for new clothing produced by CTU. (You could export the CAS part file from the game files and use other tools to modify it, but using CTU is usually much easier.) The type ID is 034AEECB and S3PE exports it with a .caspart extension. It describes the clothing - all the flags for category, gender, age; links to the textures, the vpxy files that link to meshes, and the blends that link to the morph/BGEO files.
#8 Old 11th Dec 2009 at 2:56 PM
I think I did, what do you think?
Ms. Byte
Original Poster
#9 Old 11th Dec 2009 at 3:40 PM
Looks great! You need to test in-game too, of course, and make sure the morph is working in lod2 and lod3. So far so good!
#10 Old 12th Dec 2009 at 12:35 PM
I try to do this again and now don't work always give me an error when I click "Create BGEO"
Please help
Ms. Byte
Original Poster
#11 Old 12th Dec 2009 at 1:46 PM
Please give details when there's a problem - what's the error message? Can you post a screenshot?
#12 Old 12th Dec 2009 at 2:32 PM
Ms. Byte
Original Poster
#13 Old 12th Dec 2009 at 2:48 PM
It's not finding the "GEOM" tag that should be in the geom or simgeom file. Are you sure you're selecting the correct file to open? Could you post the file?
#14 Old 12th Dec 2009 at 2:58 PM
Ms. Byte
Original Poster
#15 Old 12th Dec 2009 at 4:31 PM
The morph mesh file you're trying to open/add to BodyMorphMaker when you get the error.
#16 Old 12th Dec 2009 at 5:00 PM
I hope is this..
Download - please read all instructions before downloading any files!
File Type: rar BootsMorphFat.rar (384 Bytes, 28 downloads) - View custom content
Ms. Byte
Original Poster
#17 Old 12th Dec 2009 at 6:50 PM
Okay - looks like two problems here. First, the vertex numbers for your three lods overlap. They must go in order starting with lod1, then lod2, then lod3, with no overlap. You can try using Wes's autonumber tool to fix this.

Second, my software didn't take into account higher vertex numbers like shoes and so on. I've already been working on fixing that. A new version is attached - try that after you fix the numbering problem. This is kind of a beta so let me know how it works.

I'll check back but hurt my wrist falling off a ladder and typing is painful - may not be on a lot today.
Download - please read all instructions before downloading any files!
File Type: zip (776.6 KB, 49 downloads) - View custom content
#18 Old 12th Dec 2009 at 10:11 PM
#19 Old 14th Dec 2009 at 8:11 PM
Sorry to bother you again, but I think I'm doing something wrong...and I need your help.
I need the VPXY file?
What I do with the BGEO and the Blend?
Ms. Byte
Original Poster
#20 Old 14th Dec 2009 at 8:29 PM
No problem.

The VPXY file is optional - you shouldn't need one.

The BGEO and the Blend go in the package for your clothing. If you're having a problem you can post your complete package and I'll take a look.
#21 Old 14th Dec 2009 at 8:34 PM
Thanks! How I package BGEO and the Blend?
Ms. Byte
Original Poster
#22 Old 15th Dec 2009 at 7:46 PM
You have to add them to the package for your clothing using s3pe, Postal, or Package Explorer. If you created the package with CTU, you can try importing the BGEO and Blend into it. If that doesn't work in your game, try using S3PE or whatever to export all the files in your package, create a new package, and import everything into it.
#23 Old 15th Dec 2009 at 8:36 PM
I think I did all of that...
Can you please see the package?
Download - please read all instructions before downloading any files!
File Type: rar HighBoots.rar (202.0 KB, 25 downloads) - View custom content
Ms. Byte
Original Poster
#24 Old 16th Dec 2009 at 2:10 AM
Okay - first, your CAS part file needs to link to your new BBlend file, not to the original one for the clothing you based this on. You should use BodyMorphMaker to edit the CAS file and change the instance ID for the fat morph to your new instance of 0D5CE96555AA5ACC. Then the CAS file will link to your new Blend file which links to your new BGEO file.

There's still something wrong with the BGEO file, though. If you look at the headers:

Section 1 count: 1
Section 1 Subentry count: 4
Section 2 count: 44475
Section 3 count: 1205
Section 1 pre-subentry size: 8
Section 1 Subentry entry size: 12
Section 1 offset: 44
Section 2 offset: 100
Section 3 offset: 89050
Section 1:
Age/gender flags: 0001307F
Facial/Body region: 1024
First vertex (lod0): 0
Number of vertices: 0
Number of coordinates: 0
First vertex (lod1): 15139
Number of vertices: 15099
Number of coordinates: 594
First vertex (lod2): 15589
Number of vertices: 14768
Number of coordinates: 388
First vertex (lod3): 15812
Number of vertices: 14608
Number of coordinates: 223

There's no way each lod should have over 14000 vertices, plus the vertex numbers overlap.

Did you use the latest version of Wes's Milkshape plugins? An older version had a bug that wrote extra vertex data in the morphs. If that's not it, I'll have to take a look at at least one of your morph meshes.
Ms. Byte
Original Poster
#25 Old 16th Dec 2009 at 1:57 PM
Also - what kind of clothing is this? CTU shows it as shoes, but the vertex range starts with 15000, which is the starting point for bottoms. Shoes should start with 30000.
Page 1 of 4
Back to top