Important! Please read the announcement at http://myst.dustbird.net/uru-account.htm
Also! Please read the retirement announcement at http://myst.dustbird.net/uru-retirement.htm

Difference between revisions of "Reward or Takeable Clothing"

From UamWiki
Line 291: Line 291:
  
 
If you see your clothing being stretched or distorted like this, it means you will need to adjust the Envelopes on the Bones. Don't worry, I'm going to show you how to do that.
 
If you see your clothing being stretched or distorted like this, it means you will need to adjust the Envelopes on the Bones. Don't worry, I'm going to show you how to do that.
 +
 +
----
 +
==Adjusting The Envelopes==
 +
 +
In the modifier tab, open up the Skin Modifier and select where it says Envelope, select the check marks for Verticies, Envelopes, and Cross sections, and then the bone in the box you want to adjust:
  
 
[[File:AvieCloth33.jpg]]
 
[[File:AvieCloth33.jpg]]
 +
 +
'''HEY! MY RED PANTS JUST TURNED BLUE!!!''
 +
 +
Relax, it's okay. The mesh has turned into a color field to show you where the envelope is reacting to the skin. Blue means that the bone will not move that area of mesh. As you increase your envelope, you will see a rainbow of colors where bright yellow means maximum movement from the bone.
 +
 +
As you can see from the above picture, our envelope is way too small to interact with the skin. We need to make it bigger. I like using the Cross Sections to adjust this, so in my picture below click and drag on one of the boxes I have circled:
  
 
[[File:AvieCloth34.jpg]]
 
[[File:AvieCloth34.jpg]]
 +
 +
Now drag your mouse to make the circle bigger:
  
 
[[File:AvieCloth35.jpg]]
 
[[File:AvieCloth35.jpg]]
 +
 +
As you can see, the pants mesh is changing colors to show us where it is being affected by the envelope. Make it big enough to include the area you need, but not too big! If you make it too big, it will start to affect the other pant leg and we do not want that!
 +
 +
Now go down and adjust the other cross section of the envelope to again what you need:
  
 
[[File:AvieCloth36.jpg]]
 
[[File:AvieCloth36.jpg]]
 +
 +
Now check your other envelopes of the other bones and make sure they are affecting the skin like we need:
 +
 +
Foot:
  
 
[[File:AvieCloth37.jpg]]
 
[[File:AvieCloth37.jpg]]
 +
 +
Thigh:
  
 
[[File:AvieCloth38.jpg]]
 
[[File:AvieCloth38.jpg]]
 +
 +
Pelvis:
  
 
[[File:AvieCloth39.jpg]]
 
[[File:AvieCloth39.jpg]]
 +
 +
After you have done this, you can move the animation bar and see how your skin is moving with the bones. In my pic below you can see we got the right pant leg to work correctly, but the left one still needs to be done:
  
 
[[File:AvieCloth40.jpg]]
 
[[File:AvieCloth40.jpg]]
  
[[File:AvieCloth41.jpg]]
+
Okay, NOW do that for the other 2 meshes (you MUST set the envelopes for all 3 clothing meshes, Red, Green and Dark Blue)!
 +
 
 +
 
 +
----
 +
==Making The Clothing Material==
  
 
[[File:AvieCloth42.jpg]]
 
[[File:AvieCloth42.jpg]]

Revision as of 20:43, 18 July 2011

NOTE: THIS PAGE IS UNDER CONSTRUCTION AND NOT READY YET. I WILL ANNOUNCE WHEN IT IS DONE AND HAS ALL THE FILES AND INFORMATION IN IT.

Credit where credit is due! This tutorial would not have been possible without the help of GPNMilano, who did a LOT of indepth work on this and provided me with much information when I started learning how to do this. Credit also goes to Austin and Mark DeForest (aka Chogon) from Cyan for the information and help given by them.

Before you get started with this tutorial, PLEASE read the following!

This tutorial is not for a beginner in Age creation. If you have just started and are still learning how to even just model and texture your Age, you may want to get more practice in before you attempt this. The process is complex. You will not be able to use this with any of the stand alone Uru games (POTS, Uru:CC), nor will this work correctly with ALCUGS or UU type servers. You must have access to a MOUL based server in order to test what you are making due to changes in the Avatar's bone structure that were made. This is mostly due to the files I'm providing as the Avatar bone structure is based upon the MOUL avatar. If someone were to change the structure to what is used in the stand alone and ALCUGS, then you would be able to use the information here. But if you try to use it, you will find that the avatar will not look right when you put the clothing on. Instead you'll look like some deformed, mutant Bahro!

This tutorial is not meant to show you how to make clothing meshes that will fit the avatar, but instead assumes that you already have those. In the files I provide, will be a set of meshes for some pants so that you can follow along and give it a try. The documentation provided comes from Cyan, and has a wealth of information in it, including how to make the clothing meshes. Textures for clothing are special too, and must be a certain size and layout depending on what type of clothing / accessory you are making.

There are a couple of things that I have discovered while doing this: I have not been successful in making certain types of clothing, such as Jump Suits. The way the bone structure is made, it does not like once piece clothing. Combining the legs with the torso or the torso with the head (like a diving bell suit) causes problems with the avatar when it animates in game. This does not mean that it is impossible (I have learned not to use that word when it comes to Plasma and the Uru Community), however someone will have to figure out a way to makes those.

Finally, this method that I am going to show you involves adding prp files to the GlobalClothing Age. Trying to place the clothing in your Age will not work, as the Plasma Clothing material type will not export into the Age. I realize that this could cause problems, especially on a server where more than one Fan Age will have clothing. However, until someone figures out a way to work around this, it is the only way I know for it to work.

Enough talking from me. Let's get to work. There is a LOT of information to get through.


Files You Will Need

You will need to download at least the next 2 files:

BasicBoneAvatar_Male.max

This is the animated bone structure of the Male Avatar for MOUL. AvieCloth1.jpg

basic_avatar_female.max

This is the animated bone structure of the Female Avatar for MOUL. AvieCloth2.jpg

If you already have clothing mesh you have made and want to use, that is great! If you do not have any, then you can use this file here, which is just some basic pants: pants.max

You do not need this file, however this is what you should end up with at the end of the tutorial: PantsNeolbah.max

avatar-documentation.pdf This is Cyan's documentation on the Avatar for making clothing.

The following are python files made by Mark DeForest (aka Chogon) and can be extremely useful:

xOpenCloset.py

This file will allow you to let the avatar link to the Relto closet without having to go to Relto, and when they are done, will link back into your Age.

xSaveClothing.py

This file will save what the player is wearing to the client's hard drive before they put on whatever reward clothing your Age offeres.

xReturnOldClothing.py

This file will return the clothing that was saved to the client's computer in case they want to change back to the clothes they were wearing just before they put on the Reward clothing your Age offered.



Getting Started

Okay, before we dive right in, I want you to take a look at the pants mesh that is in the file I provided in the above link, even if you are going to try and use your own clothing mesh, there is something important that you will need to understand. When you open up the pants.max file, you will see this in the 3D Scene:

AvieCloth3.jpg

As you can see there are what looks like 3 sets of pants. In reality there are 5, as 3 of them are all sitting in the same place. The coloring of the meshes is very important, as it helps you keep track of what mesh is what:

The Red mesh, is considered High Ploy or High Faces. This will be your highest resolution of your clothing Mesh.

AvieCloth4.jpg

The Green Mesh is considered the Medium Poly or Medium Faces mesh.

AvieCloth5.jpg

The Dark Blue Mesh is considered the Low Poly or Low Faces mesh, and will the the lowest resolution of your clothing Mesh.

AvieCloth6.jpg

These 3 meshes will sit on top of one another, and must fit over top the Avatar Bone system. The remaining two meshes that are light blue and what I call Tan are Morphing Meshes. The sit just off to the side. Light Blue is the skiniest avatar, and the Tan is the fattest avatar (don't get offended.....Tan would be MY clothing color!!! heheheh).

We also need to do something before we get started. We need to make a GlobalClothing.age file and put it in our PlasmaTest export dat folder.

Open up Notepad and use this:

StartDateTime=0000000000
DayLength=24.000000
MaxCapacity=10
LingerTime=180
SequencePrefix=-5
ReleaseVersion=0
Page=Female,2
Page=Female01,4
Page=Female02,5
Page=FemaleXP2,8
Page=Male,1
Page=Male01,3
Page=Male02,6
Page=MaleXP2,7
Page=MaleNeol,11

As you can see, I have added a Page to the GlobalClothing Age, and it is called MaleNeol, you can change this to fit whatever your Age is called. Make sure you save it and put it in your dat folder of your PlasmaTest.


Merging The Files

I need you to keep this in mind: We will be using the Male avatar for this tutorial. BUT! You MUST do what you are about to do all over again for the Female avatar! You MUST have 2 versions of your clothing for the players. If you do not, and only make it say for Male, any Female Avatars will not be able to put on the clothing and vice-versa.

Open up the BasicBoneAvatar_Male.max file in 3DS Max:

AvieCloth1.jpg

In this file, I have done many things for you already and you will not have to do them. The bone structure system is animated, and the Parent to Child hiarchy is already in place (except for your clothing Meshes, more on that later). The 5 nice looking avatars you see below the bone structure are what is called the Smoothing Bases, and used to be in a separate file. Cyan used XRef to reference them. However, for our purposes, it was easier to just merge them with this file so they are always there.

The bone structure of the Avatar is not just for their body, but both this file and the female file have the bone structure for the Relto Book in place. DO NOT REMOVE THE RELTO BOOK BONE STRUCTURE!!! This can cause problems with the appearance of the player if you do!

There are 4 Dummy Boxes: one between the bone structure's feet, called "Male" (the one in the Female file is called "Female"). The 3 boxes to the left are called "High", "Med", and "Low"

Okay, let us get the clothing mesh into this scene. Go up to your menu bar and click on Plasma, and then click on Merge. Find and select the Pants.max file you downloaded. Now your scene should look like this:

AvieCloth7.jpg

As you can see, the Red, Green and Dark Blue pants are all right on the Bone system. If you used your own clothing mesh and they are not, you will need to move them so that they are! This is for later when we "Skin" the meshes to the Bone structure.

Once you get the files merged, you need to select everything in the scene and attach a PageInfo component on everything that does not have it. Change the Age name to GlobalClothing, and the Page that you made.

AvieCloth8.jpg



The Smooth Bases

Okay, we are going to do some work with the Smoothing Bases here. I could have done it all for you, but then where is the fun in that? Go down and select all the meshes for the Red (High) Smoothing Avatar:

AvieCloth9.jpg

Now open up the Component Manager and click on New > Render > Smoothing Base and attach it to these meshes.

AvieCloth10.jpg

Rename the component to what you see in my picture below. Renaming the components is also a MUST to help keep track of things!

AvieCloth11.jpg

You can leave the Roll Out for it alone as the default settings are fine.

Now go and select all the meshes of the Green Smooth Avatar (Med), and attach a NEW Smoothing Base component to it too (DO NOT use the same one you just attached to the High mesh!). Rename it also so that you know it is for the Medium Smoothing Mesh:

AvieCloth12.jpg

Repeat these same steps for the Dark Blue Smooth Avatar (Low), and again, rename the component.

Now go down and select all the meshes for the Light Blue (Cyan? heheheh) Smooth looking Avatar. This is the Morphing Mesh Smooth Base for our High Mesh. Repeat the steps above and attach the Smoothing Base component to it too, and rename it:

AvieCloth13.jpg

Then go over and select all the Tan Smooth Avatar, and again, repeat assigning the Smoothing Base component to it too, also renaming it:

AvieCloth14.jpg

This means you should have FIVE Smoothing Base components in the Component Manager now!


The Parent

Go to between the Avatar's feet and select the Male Dummy box that is there.

AvieCloth15.jpg

If you then hit the "H" Key, you will see the selection box, and can see that just about everything is parented to the Male dummy box. The exceptions to this are the Smoothing Base Avatars.

You may notice that our Pants meshes are not either (or whatever Mesh you used). You need to select each one at a time, and parent it to the High, Med, and Low Dummy boxes:

AvieCloth16.jpg

So select the Red Pants, and parent it to the High dummy box. Select your Green pants and parent it to the Med dummy box, and then select the Dark Blue pants and parent them to the Low Dummy box The remaining 2 meshes (the light blue and Tan color pants) do NOT get parented to anything.

However, now it is time to work with them. Select the Light Blue pants. Open up the Component Manager and click on New > Render > Snap To Base and assign it to them.

AvieCloth17.jpg

Rename the component, and then in the roll out for it, click on the button below "Smoothing Comp Of Base Set" and then click on the Light Blue Smooth Avatar:

AvieCloth18.jpg

Now click on the Tan pants and do the exact thing for them too (only make sure it's a NEW Snap To Base component, and this time click on the Tan Smooth Avatar):

AvieCloth19.jpg


High, Med, and Low Dummy Boxes

Okay, time to mess with our High, Med, and Low Dummy boxes. Select the High one:

AvieCloth20.jpg

Open up the Component Manager and click on New > Avatar > Morph Layer and assign it as a component to the High Dummy box:

AvieCloth21.jpg

In the Roll Out for it, you'll see a box called "Delta Meshes" and an Add Button:

AvieCloth22.jpg

Click on the Add button and then click on the Light Blue pants

Wait. What the heck is "Delta Meshes"???? "Delta Meshes are the meshes that we can morph or change to. "Delta" is the symbol used for "Change", and is used in math, physics and many other things.

Now assign a 2nd Morph Layer to the High Dummy, changing it's name, and in it's roll out, click on the Add button, only this time click on the Tan pants

AvieCloth23.jpg

What we just did is told the game that your pants can Morph down to as small as the Light Blue mesh, but get no smaller, and it can also get as big as the Tan mesh, but no bigger.

Open up the Component Manager and click on New > Avatar > Morph Sequence, and assign this to the High Dummy box, and rename it too:

AvieCloth23a.jpg

In the roll out for this mesh, click on the Neutral Mesh button and then click on the Red pants Mesh. In the Box that says Morph Layers, click on Add and in the box that pops up, select the 2 Morph Layers that are assigned to the High Dummy

AvieCloth23b.jpg



Skinning The Bones

Now it's time to "Skin" our Pants Mesh to the Bone structure. This is important because if you have messed with the Animation Bar, you've seen that the bones move, but not the pants:

AvieCloth30.jpg

Let us start with the Red or High Mesh pants. Select them and then click on the Modifier Tab. We need to add UVW Mapping to this mesh. So do that:

AvieCloth24.jpg

You do NOT need to edit the UV Mapping. Adding the Unwrap UVW modifier simply gives the mesh mapping coordinates and that is all we need.

Next, go up to the menu bar and click on Modifiers > Animation > Skin and give it that modifier:

AvieCloth25.jpg

Open up the Skin Modifier. You see that you have a empty box and we need to put bones in there. We do this by clicking on the Add button I have circled in my picture below:

AvieCloth26.jpg

So how do you know what bones to add to what clothing mesh? I mean, to me, Pants should just need the Pelvis, Thighs, Calfs and that should be it, right? Wrong. Pants also need the Spine0 bone and the Feet. Here is what bones you should use for most clothing:

Hat or Helmet - Head, Neck, Spine2.

Torso (shirts, vests, jackets, etc) - Neck, Spine0, Spine1, Spine2, All Clavicles, Upper Arms, Fore Arms, Hands, Pelvis.

Pants - Spine0, Pelvis, Thighs, Calves, Feet.

Gloves - Fore Arms, Hands, Fingers.

Shoes - Calves, Feet, Toes.

That should help you out some.

Now, you will need to do this to the Red (High), Green (Med), and Dark Blue (Low) clothing meshes: Add UVW mapping coordinates, and then the Skin modifier, and add the bones to the modifier.

The envelopes for the Bones are what Cyan has set for the pants all ready, however, if you are using your own mesh that you have made, or modified an existing clothing mesh, you will need to move the animation bar and make sure the clothing moves with the bones, line the next 3 pictures show:

AvieCloth27.jpg

AvieCloth28.jpg

AvieCloth29.jpg

Now, if you moved the animation bar, and instead you got this:

AvieCloth30.jpg

It means you did not add the UVW mapping modifier (or you collapsed the tree. I have found that collapsing the tree can cause this problem), or you did not pick the correct bones!

Or you may have seen something like this:

AvieCloth31.jpg

This means you did not do all the clothing meshes yet.

OR......

You more than likely will see this, especially if you are using your own meshes you made:

AvieCloth32.jpg

If you see your clothing being stretched or distorted like this, it means you will need to adjust the Envelopes on the Bones. Don't worry, I'm going to show you how to do that.


Adjusting The Envelopes

In the modifier tab, open up the Skin Modifier and select where it says Envelope, select the check marks for Verticies, Envelopes, and Cross sections, and then the bone in the box you want to adjust:

AvieCloth33.jpg

'HEY! MY RED PANTS JUST TURNED BLUE!!!

Relax, it's okay. The mesh has turned into a color field to show you where the envelope is reacting to the skin. Blue means that the bone will not move that area of mesh. As you increase your envelope, you will see a rainbow of colors where bright yellow means maximum movement from the bone.

As you can see from the above picture, our envelope is way too small to interact with the skin. We need to make it bigger. I like using the Cross Sections to adjust this, so in my picture below click and drag on one of the boxes I have circled:

AvieCloth34.jpg

Now drag your mouse to make the circle bigger:

AvieCloth35.jpg

As you can see, the pants mesh is changing colors to show us where it is being affected by the envelope. Make it big enough to include the area you need, but not too big! If you make it too big, it will start to affect the other pant leg and we do not want that!

Now go down and adjust the other cross section of the envelope to again what you need:

AvieCloth36.jpg

Now check your other envelopes of the other bones and make sure they are affecting the skin like we need:

Foot:

AvieCloth37.jpg

Thigh:

AvieCloth38.jpg

Pelvis:

AvieCloth39.jpg

After you have done this, you can move the animation bar and see how your skin is moving with the bones. In my pic below you can see we got the right pant leg to work correctly, but the left one still needs to be done:

AvieCloth40.jpg

Okay, NOW do that for the other 2 meshes (you MUST set the envelopes for all 3 clothing meshes, Red, Green and Dark Blue)!



Making The Clothing Material

AvieCloth42.jpg

AvieCloth43.jpg

AvieCloth44.jpg

AvieCloth45.jpg

AvieCloth46.jpg

AvieCloth47.jpg

AvieCloth48.jpg

AvieCloth49.jpg

AvieCloth50.jpg

AvieCloth51.jpg

AvieCloth52.jpg

AvieCloth53.jpg

AvieCloth54.jpg

AvieCloth55.jpg

AvieCloth56.jpg

AvieCloth57.jpg

AvieCloth58.jpg