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!
Not actually evil.
Original Poster
#1 Old 4th May 2008 at 3:55 AM Last edited by CatOfEvilGenius : 10th May 2008 at 2:58 AM.
Default TUTORIAL : skins - adding/removing face/body textures
level 3 - intermediate

What you will need:
- skin package file (to edit)
- SimPE (tool for editing package files)
- NVidia DDS Utilities (so you can load image files)

What you should already know before you begin:
- how to make skins, covered in Making a New Skintone for Beginners
- how to open a package file with SimPE.


Why add/remove face/body textures?

REMOVING FACE / BODY TEXTURES
If you use the same image for both genders or several ages, there is no sense in storing several copies of it. Removing redundant image copies will make your package file smaller. This is a good thing.

ADDING FACE / BODY TEXTURES
If you want to use different images for the genders and/or ages, but your package file uses the same image for them, you will need to add new image(s) to it. This will allow people who used the old skin package to replace it with the new skin package, without having to change what skin their sims are wearing. This is a good thing. (This tutorial assumes you have already made the new images you want to add.)


Key Concepts

Whether you are removing or adding face / body texture files, you will need the key concepts presented in this section.

TEXTURE IMAGES AND MATERIAL DEFINITIONS
- What are they?
- Why are they paired?
- In each pair, what three values need to match?

The face, body (and scalp) images the skin uses are all stored in the Texture Image (TXTR) resource. The Material Definition (TXMT) resource specifies which texture image is used for what purpose : ie. use this image for the adult female face, use that image for the teen male body, etc. Both resources can be found in the Resource Tree shown in Figure 1, just click on one of them to see the textures or material definitions in it.

Figure 1 Resource Tree

A material definition is paired with a certain texture image. This is done through matching the texture file name, texture instance number, and texture instance (high) number, among other things. You will learn how set / change these three important values. But first, let's look at where these three values can be found.

In the Resource Tree, click on the Material Definition (TXMT) resource. In the Resource List, to the left of the Resource Tree, you will see a list of individual material definitions. Here is an example of a material definition name:

##0x5f49483a!amface~face_txmt

The important thing to note here is the name tells you the age, gender, and body part that this material definition is for. In the example above, we have an adult male face. It is helpful to sort material definitions alphabeticaly by clicking Name at the top of the Resource List. Here are other possible letters / words that could be in the name, and their meaning.

AGES
b - baby
p - toddler
c - child
t - teen
a - adult
e - elder

GENDER
f - female
fm - both female and male (for baby, toddler, child)
m - male

BODY PART
body
bodycut - for fit sims
bodynormal - for nonfit / nonfat sims
bodysoft - for fat sims
face
hair
top


Now, let's see which texture image this material definition uses. Figure 2 shows you details of the material definition for our example adult male face. You can see part of the texture image filename in GREEN, the texture instance (high) number in PINK, and the texture instance number in BLUE. Next, in Figure 3, let's look at where we can find these same three values in the Texture Image (TXTR) resource. We'll get to how and where to change those later...


Figure 2 material definition details : texture image filename (GREEN), texture instance high (PINK), texture instance (BLUE)


Figure 3 texture image details : texture filename (GREEN), texture instance high (PINK), texture instance (BLUE)


REMOVING REDUNDANT TEXTURES

Let's say both your teenage and adult male and female sims wear the same face texture. Body shop would have made four copies of the texture: teen female, teen male, adult female, adult male. Each material definition has one texture, but a single texture can be used by several material definitions. So you can get rid of three of three redundant texture copies. You'll then need to modify three material definitions to tell them to use the one copy of the texture that is left.

1) Find out which of the textures are redundant copies. In our example, you would look at the material definitions for teen/adult male/female faces. Write down the numbers circled in green in Figure 2.

2) Go to the Texture Image (TXTR) resource. Remove the texture images whose names end in those numbers. You do that with the menu shown in Figure 4.

- right-click the redundant texture image you want to remove
- select Delete from the right-click menu
- that texture now appears crossed out in the list
- save the package file (File menu, Save)
- do this for all the redundant copies of the texture, but keep one copy!


Figure 4 texture image right-click menu

3) Change material definitions whose textures just got removed.

- In the TXTR resource, look at the name of the one texture copy you kept (green box in figure 3).
- Go to the TXMT resource. For each material definition whose texture was removed, do the following:
+ change the texture name (green oval in figure 2) to match what is in the green box in figure 3
+ press Commit
+ save the file

4) Make the texture image instance and instance (high) numbers match in the texture image and the material definition.

- Go back to the TXTR resource and select the one texture you kept.
- See where it says "fix TGI", near the green oval? Click "fix TGI".
- press Commit
- save the file

If you did everything correctly, then the instance (high) and instance numbers of the texture image (pink and blue boxes in figure 3) should now match the values in the pink and blue ovals in figure 2. Check that this is so. If it is not, try this again, make sure you don't accidentally skip any steps, especially Commit and Save.


ADDING MORE TEXTURES

Let's say the old version of the skin you're working on used the same face for male and female elders, but you want them to have different faces. Let's also say whoever made the old version decided to save disk space and got rid of the redundant image for elder males, made them use the image for elder females. Well, you'll need to add a new image for elder males and update the material definition for elder males to use this new image. (You can also use this procedure to add several new images for ages / genders / body parts, just keep a list of what you're adding and what image goes with what age / gender / body part.)

1) Add the new image.

- Go to the TXTR resource.
- Right click the last texture in the list (it doesn't really matter which one you pick)
- In the right-click menu (see Figure 4), select Clone.
- You now have a new texture image

2) Modify the new image.

- Give the new image a new name (green oval in Figure 3),
only change the part in the green oval and pick some randox hex value
- Press Commit
- Save the file

- Load the new image from an image file
+ right-click the picture
+ select Build DXT from the right-click menu
+ in the DDS Builder dialog, make sure the format is DXT 5 and Sharpen is None.
+ in the DDS Builder dialog, click "open", pick the image file you want
+ in the DDS Builder dialog, click Build
- The picture should now show the image you just loaded
- Press Commit
- Save the file

3) Change the material definition(s) that use this texture image.

- Go to the TXMT resource.
- For each material definition that should use this texture, do the following:
+ Change the texture image filename (green oval in Figure 2) to match the value in the green box in Figure 3.
+ Press Commit
+ Save the file

4) Make the texture image instance and instance (high) numbers match in the texture image and the material definition.

- Go back to the TXTR resource and select the one texture you kept.
- See where it says "fix TGI", near the green oval? Click "fix TGI".
- press Commit
- save the file

If you did everything correctly, then the instance (high) and instance numbers of the texture image (pink and blue boxes in figure 3) should now match the values in the pink and blue ovals in figure 2. Check that this is so. If it is not, try this again, make sure you don't accidentally skip any steps, especially Commit and Save.
Screenshots

Please spay or neuter your pets. --- Cat Music Video! --- my meshes
Advertisement
Lab Assistant
#2 Old 19th Jun 2008 at 6:04 AM
Very nice! Thanks for teaching this method. I've changed faces in a skin before, and it's very difficult to tell which ages the face maps belong to.

"They can jump, and land, and have no natural predators. Unless, of course, you count me!" *SH-BOOF!* - The Maxx
Scholar
#3 Old 17th Mar 2009 at 11:44 PM
Very interesting, very well explained...thank you. Pdf version available ?

Understand Material definition-TXMT and customize the look of your objects ! This way

"The longer something exists in this world, the more wear and tear it will have."
Not actually evil.
Original Poster
#4 Old 18th Mar 2009 at 12:05 AM
pixelhate Sorry, no pdf at this time. Remind me later this week and I'll make one.

Please spay or neuter your pets. --- Cat Music Video! --- my meshes
Doing all the things, and *mostly* not failing.
retired moderator
#5 Old 3rd Mar 2012 at 9:00 AM
I need to remember this for one of my projects. You've outlined it so much simpler than how I managed to stubble through this on my own the first time. Thank you.
Back to top