2009
11.28

Create a Jacket for IMVU

In this tutorial we will be making a jacket for the IMVU male avatar. Making clothing can sometimes be tedious since it has to conform to the model’s body shape. However i will show an neat technique to quickly make clothes for the Avatar.

First we need to load 3ds max and the Male avatar
Male03_Anime01_WeightingPoseMASTER.max

maleavi

Now that we have our Avatar loaded up what we want to do is clone his chest. So let’s go ahead and click our select object tool selobj1

Now go ahead and select the avatar’s chest and click Edit >> Clone

clonechest

It should bring up the clone object window. We want to make sure its set to copy and give it a new name so we can easily find it from the select-from-list tool.

cloneoptions

Go ahead and hit Ok. Now we want to click the modifier tab then right click on the physique modifier and click delete.

deletephys

Ok now that we have removed the bone weights we can start modifying the mesh. Go ahead and Expand Editable Poly then click vertex to activate it.

vertexmode

Alright first and foremost the ends of the arms are going to be our sleeve cuffs, but the model doesnt look exactly rounded on those ends. So what we want to do is to move the vertices using the positioning tool positiontool in a way so the ends line up like the cuff of a sleeve.

makjesleeve1

We want to do this with both sides. Go ahead and spend some time making the ends of the sleeve line up the way you want to. this is pretty much what i ended with.

sleeve

Now that we have our sleeves the way we want them, i want to now make this jacket open in the front. So go ahead and pan the front view over to the chest. If you notice from the modify tab there is no Face selection since we are using Edit poly. We want to be using edit mesh. So Fisrt go ahead and click on edit poly so it takes us out of any editing mode it may be in, then from the modifier drop down menu select edit mesh.

editmesh1

Now lets expand edit mesh and click on Face also scroll down your rollout menu until you see ignore backfaces and check it, we don’t want to accidentally select polygons on the otherside of the model.

ignoreback1

Now in the front view i want to select faces along the center downward where the opening will be in my jacket.

frontface

It helps alot to also check it in the perspective view to make sure they are all selected, it doesnt have to be perfect at the moment since the polygons are irregular going doward we can adjust ther vertices to straighten it out later. Now lets just go ahead and delete those faces by pressing Delete.

Now that we have a nice cut in the front of our jacket we really don’t want the jacket to be skin tight. We could just simply scale it, but the problem is you’ll find the model doesn’t line up correctly. No what we want to use is the push modifier, this will push out all the vertices along their normals making it bigger and allowing it to fit correctly. So go ahead and click Edit Mesh to turn off the editing mode. Then from the modifier drop down menu let’s select push.

push

If you notice the only option in the rollout menu is push value. Go ahead and click the up arrow and hold the mouse button down while dragging the mouse up. You’ll notice your jacket is getting thicker and actually looks more like a jacket.

Go ahead and go crazy with it lol, or at least get it how you want it to look. here is how mine looks.

pushjacket

Cool, once your satisfied let’s add another edit mesh modifer to the stack and align those vertices in the center. I just use the postioning tool and move it along its X axis until i have it looking decently straight. You don’t need to make it look perfectly straight in fact it should have some slight variance since its semi-loose clothing.

straightjacket

Ok next couple things we want to add are cuffs and a collar. Alright so first we need to line up the vertices to make a decent cuff. So Pan over to one of the Sleeves and move the vertices 2nd from the front to make the front of the sleeve like so.

sleevecuffs

Try to get the front and the back sides of the models to look the same as well as the left and right sides. After you have that lined up we need to select the faces around the cuff.

Then we want to extrude it out just a pinch. You may need to switch the extrude mode from group to local for it to extrude outward along the faces normals.

extrudecuff1

Go ahead and do the same for the other cuff. So it should look reasonably the same as this:

cuffs

Great all we have left to do is the collar. Now while your still in Face editing mode go ahead and select all the faces around the neck.

collar

Now we want to Bevel these faces out as well. Make sure extrude/bevel is set to local and extrude it out only slightly, then bevel it inward.

bevelcollar

Next let’s select Edge from the Edit mesh list. We want to select the top-middle edges around the collar like this.

collaredge

You may have to use the perspective viewport to catch all the edges. It can be a bit tedious, having ignore backfaces box checked can make the job a little easier. Once you have the edges selected we will want to extrude them. Make sure this time the extrude mode is set to group. Now extrude it, it should go upward along the Y axis like this.

extrudeedge

I’m hoping they went up along the Y axis for you as well. now the next thing we want to do is in the top view using the scale tool scaletool1,  scale the edges out along the X & Y axises. Which should have made the collar look like this.

scalecollar

Now using the positioning tool we want to move those edges downward along the Y axis, which should in turn create a nice collar. You may need to go into Vertex mode to adjust some of the vertices so the collar rests upon the shoulders nicely.

collardone

Sometimes going into face mode and selecting the collar’s faces can help you see if a face or vertex is going into or through another face. Especially when everything is the same color. Anyways once you have your collar the way you want it we do need to go to face mode and select the collar’s faces like the above pic. Then we want to scroll down the rollout menu to the material section and assign the (Set ID) to 2.

Now with Face still and Face editing mode still on we want to add UV Mapping from the modifiers list. This will allow us to map the collar and nothing else.

uvcollar

Hopefully the Orange Gizmo Plane lays flat over your collar like this. If not you may need to Expand UV Mapping and Select Gizmo, use the rotation tool rotatetool and rotate it until it lays flat over your collar. Once you have it set that way or if it already was then we need to add unwrap UVW modifier. Scroll down to the rollout menu and click Edit..

edituvw

It should have opened a window with a flat view of your collar. these are the faces coordinates on your texture image. For now this is fine we don’t need to modify this.

Now i think its time to go ahead and collapse our Modifier stack down. Right click on Unwrap UVW then hit collapse All, then again hit Yes tot he warning window that pops up. Depending on your machine you may see 3dsmax Wig out for a sec when collapsing, this is normal on the IMVU model. there are many hidden modifiers applied to the model and thats why it seems like it flips out when collapsing. just wait it out it will finish up after a few seconds.

Alright once 3dsmax is done wigging out lol, we want to expand Edit Mesh and click Face. Scroll down the rollout menu to the Materials Section. We want to enter 8 in the Select by id then click the button. Since we used the avatar’s chest which already had the material 8 assigned to it we can select all the faces except the collar just by selecting by material ID. This is also a handy way to select certain faces when working with models.

selectid

Now what we want to do is have only the chest area selected and not the arm. So click your select object tool, go into preferably the front view Hold down Alt and select one of the arms. You should have noticed it deselected it. What we want to do is deselect the arms so only this portion of the model is selected.

chestsel

Alright let’s go ahead and scrolldown our rollout menu to the materials section and enter 1 in (Set ID) then press enter.

setid1

Now while your faces are still selected and your still in Face editing mode lets add the UVW Map modifier to the stack.

This time we want to use cylindrical mapping.

cylmapp

Ok what this will do is unroll the mesh like unrolling a carpet onto a flat plane. But we need to specify where it splits the mesh there is a green line that goes down vertically with the cylinders sides. this is the seam or slice it will make when it starts to unroll the cylinder. Since our jacket already has an open spot in the front we can use that as our seam.

So go ahead and expand the UVW Mapping modifier and select gizmo. Click the Rotation tool rotatetool look for the green line going vertically down the cylinder and rotate it to the front. If it halps you can use snap angle so it will rotate on snap points which help in keeping things lined up.

anglesnap

If you right click on Angle Snap you can set its properties. It currently defaults to snap at every 45 degrees which is adequate for what we are doing but if you want more refinement when rotating use 10 or 5 degrees. This helps keep the rotation from getting into float numbers like 43.4753475 degrees opposed to just simply 45 degrees.

So lets find that green line and rotate it to the front.

greenline greenline2

Another thing we need to do is scale the gizmos so it encompasses the mesh properly. Go into the top view and scale it so it fits right.

scalegizmo

Once we have it fit correctly and the greenline is in the front, let’s go ahead and Add the Unwrap UVW modifier. Scroll down and click Edit.

unwrapjacket

If all’s well it should look something like this, both ends of the jacket opening should be on the left and right while the rest flows into the otherside. This is a great way to create seamless jackets.

Alright everything looks ok, if you want to modify it a bit like pulling out the collar vertices a pinch so you can get more detail in there than go for it. After your satisfied Let’s right click Unwrap UVW modifier and click collapse all again.

It may still wig out on you. After its Done expand Edit Mesh and click Face again, Scroll the Rollout Menu down to Material again and enter 8 in Select ID then press the button, you should notice that it only selects the sleeves now.

sleeveuv

Since the Sleeves are both at odd angles we can’t cylindrical map them at the same time or it would look odd. So we will need to Deselect one of them by holding Alt and Selecting one of the sleeves in the viewport.

sleevesel

Go ahead and scroll down the rollout menu to the material section and enter 3 as the (Set ID). Now let’s go ahead and add UVW Map Modifier again to this. Select Cylindrical mapping. Now we need to Expand UVW Mapping and select gizmo. Wedont want to rotate it into position just yet, first we need to line up the green line so it sits under the sleeve. this would be the least visible spot for a seam to be at, with a good enough texturing job you may never see it, especially if you use the offset filter in photoshop. So lets go ahead and rotate the cylinder gizmo so its flowing along the X axis and the green line is facing down.

sleevemapping

Next we want to scale it along its X axis in the front view so its long or even longer than the sleeve, we also need to scale it down on its Y ixis because it seem to be a bit wide on one side.

sleevemapping2

Now we can turn off Angle snap to help line up the gizmo in the different viewports. You may even need to use the positioning tool to line it up correctly. This is how i have it set.

mappedsleeve

Go ahead and add the Unwrap UVW modifier and click Edit, you should see something similar below.

sleeveunwrap

Now we are going to be putting both sleeves on the same texture so highlight all the vertices and scale them so they all fit on the top half of the box like so.

sleeveunwrap2

Now Right Click on Unwrap UVW and click Collapse all again. We are going to yet again go back to Edit Mesh - Face Scroll down to the material section and enter 8 in Select ID then click the button. You should have noticed the other sleeve is now highlighted. Now go ahead and enter 3 in (Set ID) and hit enter. With it still selected Add the UVW Map modifier once again. And basically Follow the same previous steps as the other sleeve on this arm.

unwrapsleeve2

Once you get it UV mapped nicely on the other sleeve. Now its time to again add Unwrap UVW and click edit. This time we want to scale and put the UV coordinates on the bottom half this time.

lastuvmapp

Well thats that hit collapse all. Now its time to use Texporter to grab our Texture maps.

So go to the tools section and click more.. Texporter.

tools

Use these settings listed

texportersettings

Make sure Only ID is set to 1, click Pick object and then select your jacket. It should generate a texture like the one below, click the disk icon and save it somewhere.

chesttex

Go ahead and change (Only ID) to 2 and do the same Pick object then select the jacket, it should have spit out our texture map for the collar. Save it and repeat the process again for ID 3 this will be our sleeves and then save it again.

Now that we got all of our texture maps its time to add our material. so go to the menu above and click Rendering >> Material Editor.

mateditor

Now we need to set The Material to Multi\Sub-object which is what Cal3d exports to. Do do this select a blank material Click the Standard button to the left and hit Multi\Sub Object

mateditor2

IMVU has a particular Naming convention it uses for its materials. If you read my last tutorial on how to make a sword

I explain the naming system. Once we have multi/sub-object material set up we need to add our chest in material slot 1. Click on the first slot material. Rename it to Chest [0], then click on the Diffuse color button and select Bitmap. Find your Chest Material and load it in. Make sure to click Visible in Viewport Button

mateditor3 mateditor4

mateditor5

Do the same for the Collar and Sleeves. Just make sure to add 1 to each material Id so it reads e.g.

  • Chest [0]
  • Collar [1]
  • Sleeves [2]

mateditor6

Once you have all your materials in go ahead and apply it to the jacket, make sure the jacket is selected and then click the Assign Material to selection button.

assignmat

Now we have our jacket all textured and ready to go, we need to weight it to the Avatar skeleton. This time around we are going to use the physique modifier.

jacketrender

Now go to the modify Tab and add the physique modifer to the Jacket model. Down below in the rollout menu you will want to click Initialize.

physique

Since our jacket is only weighted to the top half of the avatar our base node should be the Pelvis node and up.

You will want to either locate PelvisNode from the Select from list tool or click on the node near the avatar’s groin to begin initializing the physique modifier. Once you select it a window will pop up like this. Just click initialize.

init

Physique can be a tricky devil to get the weights to not only weigh to the bone, but also deform correctly when the bone’s move. So let’s check to see how many vertices are not attached. Expand Physique and then click Vertex. You want to click the red and green plus icons to deactivate them leaving only the blue plus active. Now drag a selection square over the entire model. if you see any blue vertices that means those vertices are not weighted to the model.

initphys

So there are two ways to do this, the first way is to edit the envelopes which is preferable, binding the vertices using envelopes you will have more smoother deformations of the mesh when the bones move. The other way is to while in vertex mode just simply weight the blue vertices to a bone. Which will cause less smooth deformations, so lets try fixing this with envelopes. so click on Envelope and select the scale tool. the click on a bone where you saw the blue vertices. more than likely the arm. Lets go ahead and scale that envelope up. you’ll notice as you scale it up vertices will highlight red, this means they are fully weighted to the bone. You can switch back and forth between Vertex and Envelope to check how many vertices still need to be weighted.

weightbone

You may run into problems with one of the attachment bones to remove the problem just click the bone line going to it and shrinks its envelope to non existence.

boneproblem1

Once you have it so that silly bone is gone, you may even need to use the positioning tool and move the envelope waaaay off screen somewhere out of the way so it doesnt influence your model . If all the blue vertices are gone try moving a few bones around to make sure it deforms properly. Make sure to undo any bone movements you do or it won’t export right. Getting Physique to look right is tricky. even though you think you may have everything weighted it can show up goofy in the previewer. If you have to keep adjust envelopes until you finally get it weighted properly.

If everything looks good its export time. Usually the IMVu model comes with a pre exported skeletal file. So all we need to do is Export the Mesh and the Materials. So with your jacket selected go to File >> Export and then select the Cal3d Mesh MXF filetype, Save the File as whatever you want just make sure you manually type in the xmf extension. Hit save, it should ask you for the Skeletal file. Make sure its Female04_Anime01_SkeletonMASTER.xsf then keep hitting Next and then finally Finish.

skeleton

Now all we have left is to export our materials, which is super easy. Just go to File >> Export, Select Cal3d Material File Xrf. Let’s Export the Chest portion first, So Name it Chest.xrf (make sure you type the extension)

Then on the next window locate your material for the chest.

chestmat

Hit next and then Finish, do the same for the Collar and Sleeves and your done!

Since this is a clothing item your going to need to supply a body part for instance the chest along with your model. Since attaching the Jacket to the chest and then re-physique-ing the model would have been a chore and a half i decided to skip that part and show you an alternative way to combine the two models in notepad without having to go through the trouble of re-weighting the chest. So go ahead and click to select the avatar’s chest. Then export it as an xmf file. like avichest.xmf

avichest

Go ahead and hit Next again and again and then hit finish. Now browse to the avatar chest file and jacket file right click on the Avatar chest file and and then select open with.. choose notepad.

avichestxmf

Since we are combining the two XMF files we need to change the Number of submesh from 1 to 1 + # submeshes in the other file. If we open up our jacket file in notepad you should note the number of submeshes is 3

jacketxmf

So we need to change the NUMSUBMESHES from 1 to 4 in the avichest file.

Then we now need to copy the submeshes from our jacket file into the Avatar chest file. So we need to Highlight and Select the First submesh in the jacket file and Scroll to the very bottom and hold shift and click right after the last submesh.

jackselxmf jackselxmf2

Now hit Edit >> Copy, We want to paste it into the Avichest file right after the last submesh.

pasteitin pasteitin2

Now after it’s pasted in Save and your ready to import it into IMVU. Remember this is clothing so derive from a shirt or something NOT an accessory.

If you ever run into a problem where a material didnt load. check the XMF file for these Header lines

<SUBMESH NUMVERTICES=”238″ NUMFACES=”401″ NUMLODSTEPS=”0″ NUMSPRINGS=”0″ NUMMORPHS=”0″ NUMTEXCOORDS=”1″ MATERIAL=”0″>

if the MATERIAL = -1 then that means there was a problem when it exported. you can easily remedy this by changing the -1 to the material number that body part is supposed to have. For example if it was the IMVU chest change the MATERIAL to 8 save then reload it.

And here it is in the Previewer

previewer1

Just remember the hardest part is probably going to be getting physique to work right. If your still having troubles try looking online for some good tutorials on how to work with physique.

No Comment.

Add Your Comment

You must be logged in to post a comment.

AWSOM Powered