Tutorials:CAS Creation From Start-To-Finish - Meshing

From SimsWiki
Revision as of 08:35, 6 August 2011 by Daluved1 (Talk | contribs)

Jump to: navigation, search
CAS Creation With Daluved1: From Start-To-Finish

Planning | Meshing | Creating A New Package | Texturing | Finishing Up | Glossary

Contents

Meshing

We can technically make our Hello Kitty shirt using the already existing EA t-shirt. But what fun is that?! You are most likely reading this tutorial to learn how to really create custom clothing, and making you own meshes adds an extra kick to your creation!

Extracting Meshes

Daltut-findacaspaprt.jpg
So now that we've decided which CAS part we are going to clone, it's time to extract some base meshes to build our custom mesh off of. Click Extract Meshes just under the CAS parameters. A window asking where to save your meshes will pop up. Choose whatever destination folder you want to save your work files in and click "Okay". You may close CTU for now.

I highly recommend you make an independent folder for all of your project work files, as CAS creation can get a little messy.

Looking where ever you saved your files, you should now see four new files:
Daltut-simgeom.jpg

There are three SIMGEOM files and one VPXY file. You can discard the VPXY file as it is not used. The three .simgeom files are the three lod meshes of the shirt.


The word "lod" is an acronym that stands for level of detail. Lod 1 is the highest level of detail, where as lod 3 is the lowest. You will see lod 1 during normal - up close - gameplay. But when you are viewing sims from a distance or the game is still rendering sims, you will most likely see them in lod 2 or lod 3 form.


Multi Lod Meshes

Often times you may see meshes with multiple lod pieces:
Daltut-simgeom-multilods.jpg

Never fear! This just means that the meshes come in parts. Usually lod1_0 is the main mesh and lod1_1 is something silly, like the index finger (dead serious). So you don't have to import both to edit the mesh. However this is a case-by-case thing, so you may or may not have to edit all the lod pieces.

Importing Meshes

Now that we have our meshes, it's time to start the physical meshing using our 3D Modeling program. Remember, you must have the GEOM import/export plugins installed in order to get the meshes into the modeling program. So, take a moment now to verify you have everything installed!

In Milkshape go to File -> Import -> Q Mesh Sims 3 Geom Importer. Let's navigate to our three mesh files and select the lod 1 mesh. A box saying "Unable to locate bone file. Default skeleton used." will pop up, simply click "Ok".


Daltut-fixbonejointsize.jpg
Daltut-jointsizewindows.jpg
If you are greeted with...this..don't panic! You just need to adjust the joint size to something more suitable for TS3 meshes. Go to File->Preferences->Misc

Set it anywhere between 0.008 to 0.012 (less or more to your preference). Also, to ease confusion, go ahead and make the skeleton invisible by unchecking the "show skeleton" box on the Joints tab.


Blender users have a slightly different import/export procedure. Please read the instructions provided by the plugin coder or from the Blender website.

Scale/Move

Upon successful import, we should be greeted by our mesh.
Daltut-meshingvanilla.jpg
The method that we are going to use is the Scale and Move, the same method I demonstrated in my Quick Meshing video tutorials. The basic idea is that we are going to reshape our mesh by scaling and moving bits and pieces of the mesh, ONLY. That means absolutely under NO CIRCUMSTANCE should you add or delete polys/vertices from the mesh. The reason why is because the scale and move method allows us to create fantastically custom meshes, without having to create new moprhs for them, which is a pain.

Don't get me wrong, you can delete parts from meshes and even add new pieces from other meshes, this is called Frankenstiening. However, frankenstiening requires custom morphs to be made, as well as other intricate bits. So, that technique is best left for more advance creators, and will be covered in a separate tutorial. In short....Under NO CIRCUMSTANCE should you add or delete polys/vertices from the mesh. Are we clear?

So to begin our meshing, we want to get it into a workable view. Right-click on the mesh window and set it to a front projection (Projection->Front). To make it easier to see what we're doing, let's also apply a wireframe overlay to the mesh by right-clicking and selecting wireframe overlay.

I personally think that the torso of the female mesh is too square for a girl's frame, so I want to add a slight curve. To do this, I'm going to scale down the waist a bit.

We start by selecting a row of vertices, and click on the scale button. Make sure you have select-> by vertex chosen. In the three scale ratio boxes, we want to type .99 as the X and Z scale ratio.


Any scale ratio less than 1.00 will shrink the mesh, and vice versa with numbers greater than 1.00. A scale ratio of 1.00 itself, with keep the mesh neutral in that direction.


Since our scale ratio is .99, that means we are scaling in our mesh 1 percent [(1.00 - .99) x100] inward on the X and Z axis.

Daltut-scalemove-vanilla.jpg
Notice how the Y axis's ratio is set to 1.00. This means that we won't be scaling the Y axis, which you want to avoid. Alternatively, you can just click the Y button to deactivate that scale ratio altogether.


The X axis scales/moves the mesh from left to right. The Y axis scales/moves the mesh up and down. And, the Z axis scales/moves the mesh from front to back..



Daltut-scalemove-slimedtorso.jpg

Once you have decided on the row you want to scale and the appropriate scale ratio, click the smaller scale button (the one by the scale ratio boxes). Notice how our mesh has been pulled in slightly. Repeat this process until you get the shape you desire. Remember you can also use higher values, such as 1.01, to widen the mesh as you see fit.

After a little toying around, my mesh now has a slightly curved waist to fit a more girlish figure.

MWSnap019 2011-08-06, 00 48 12.jpg

I also want to make my shirt longer, so I'm going to select rows of veritces (one-by-one) and pull them down until the shirt is the desired length.

To make sure you don't knock the mesh askew when pulling it down, you can set it to where you can only move the mesh in the Y direction. To do this click on the Move button, and deselect the X and Z button.

Since my shirt is now longer, I'll have to adjust to where it won't clip into pants and skirts. To do this open CTU and locate the child female nude mesh; follow the same extract/import procedures used earlier to get the mesh into Milkshape/Blender.Use this bottom mesh to gauge the proper size of the bottom of the shirt. You can show and hide this mesh under the groups tab to get it out your way when adjusting the shirt.

After you've gotten your mesh to your desired shape, you can just delete the bottom mesh from the groups tab.

You've done a third of the meshing already, so now is a good time to save!

Adjusting the UV Map

When you make drastic - or even slight - edits to a mesh, you'll need to adjust the UV. What exactly is a UV Map? Well, it's basically information about the mesh that tells the game/program how to wrap the texture around it. If you have already done CAS creations, even small retextures, then you have seen the UV map in action - you just didn't know it! The easiest way to explain UV mapping, is to see it visually. But first, visit this thread by tiggerypum and download the templates-patternsforuvmap.zip file. Extract the two image files from the inside and drop them into your working folder.
Daltut-uvmap1.jpg
Back in Milkshape, we need to go to the Groups tab and click Select. Your mesh should now be highlighted in red. Next navigate to the Materials tab and click New. You'll see a little sphere pop up. Now click the first <none> button, and navigate to the rainbow checked pattern that we extracted from tiggerypums tutorial. Press okay, then hit "Assign". This assigns the rainbow texture to the shirt. If your mesh does not immediately show the checked texture, simply right-click -> Textured.

Ideally we want the checks to be distributed evenly on the mesh. Well, we can clearly see that there is stretching on the chest and at the bottom. Luckily this is easy to fix! However, whatever you do, do NOT create a new map from scratch. Why? Because the game uses the same UV layout for the whole body, including skin and shoes. Basically, the UV maps of every piece of clothing on your sim should flow into each other.

Make sure that your entire mesh is still selected and open the Texture Coordinate Editor by hitting Ctrl + T. Alternatively, you can go to Window -> Texture Coordinate Editor.

When it pops up, you should see your mesh flattened on the rainbow texture. Before we touch anything, we want to Lock X position by checking the box. The prohibits us from accidentally knocking the UV map off center. Now, we need to select the rows of the SHIRT on the UV map where there is the distortion and move them up or down to make the checks uniform. Whatever you adjust on the mesh will be reflected on the mesh. I suggest having the mesh in 3D view while adjusting the UV map.
Daltut-uvmapping3.jpg
I adjusted the rows near where the stretching was on the chest - being careful not to mess up the arms mapping - to fix the stretching. Now, repeat to fix the bottom, or any other discrepancies you see.

After you've adjusted the UV map properly, it would be a good time to save!

Dem Bones, aka Bone Assignments


Daltut-boneassignments.jpg

After you've altered your mesh and adjusted the UV map, there's one more thing to check. When you make meshes longer - or shorter - you may have to adjust the bone assignments. Remember that big blue skeleton that I had you turn off earlier? Well that skeleton is actually used in game to locomote the sim. Each vertex on the mesh has certain bone assignments that tells it how to move in relation the "skeleton" of the sim.

Like with UV mapping, bone assignments are better understood when they are seen visually. So, select any one vertex on your mesh and go to Vertex -> Sims 2 Unimesh Bone Tool. The particular vertex I selected was on the sims stomach area. It's movement is determined 62 percent by bone #3 - or "b_spine_1", and 38 percent by "b_spine_0".

So what does this mean to me? Honestly, even I don't understand bone weights and such. The good thing is, you don't need to know anything about which bone/weights to assign. You just need to be really good a copying other examples. :)

Before we go further, grab a pen and lots of paper!

Like we've done before, open up CTU and prepare to extract another mesh. This time we want a child female dress mesh, since this will give us the best example of how bone assignments should be done.

Import lod 1 of the dress mesh into Milkshape.

Now, in order to fix our bone assignments we are going to examine the two meshes to find vertices that are in the same vicinity.
Daltut-bones-2.jpg
For example the row of veritces on the dress mesh (red arrow) are close - enough - to the row of vertices on the shirt mesh (purple arrow). This means that we have a relatively good enough reference row to copy bone assignments from. Here comes the tedious part....

You'll need to select one vertex from your reference mesh, write down it's bone assignments via the, and copy them to the corresponding vertex on the shirt mesh (via the Unimesh Bone Tool). This is VERY time consuming, but totally worth it in the end. The reason for good bone assignments is to have smooth animation of the mesh, and to minimize clipping.

To be honest, the shirt mesh alters we've done so far in this tutorial don't really warrant redoing the bone assignments. If anything, the only thing we really have to adjust in the bottom two rows. Even this is optional. The time that you really want to focus on redoing the bones is if you do drastic edits, such as made a short skirt longer.

After you've corrected bone assignments, if needed, you can save your mesh one last time, because you are done with meshing! Well...sorta...

You can also go ahead and delete the reference mesh you used to copy bone assignments from.

Export

Once you're confident with your mesh, we can now export it out of Milkshape. To do this, click go to File -> Export -> Q Mesh Sims 3 Geom Exporter. Give your mesh a name, making sure to include "lod 1" somewhere in the name.

If your are exporting a multi-part mesh, the the exporter will ask you which pieces you'd like to export.

Lods

Now, I said you were "sorta" done with meshing. Good practice is to alter the other two lods to match the custom mesh you just finished. However, with such a small edit as the one we did, redoing all the loads isn't entirely necessary.

If you do decide to redo lod 2 and 3, just use the same scale/move method we just used.

RightArrow.gif

Step 3: Creating A New Package

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox