We need characters that have various changeable items, such as clothes and hair.
The recommendation in the manual (Modeling Optimized Characters) is to use single mesh characters, but it seems to be difficult to do in this case, in which there can be quite a few possible clothing combinations for a single character. Therefore I’ve nevertheless thought it could be possible to skin these meshes with some of the same skeleton bones (such as head bone for hair) as the main mesh and then switch on/off items from scripts as needed.
I’ve build a skeleton in Cheetah, which affects the character body mesh and it works fine. I’ve tried to attach some of the bones in this skeleton to the other items that need to move along with the body, such as hair. However this causes trouble: other parts are blown to outer space in Unity or the whole character gets distorted (seem to work ok in Cheetah though). No animation is yet attached to the skinned character. According to Cheetah, there are no scale values different from 1.0 in the body mesh or the attached mesh. Rotations are also 0 for the meshes in question. Scales for the skeleton should also be 0.
I’ve attached partial view pictures to the character with hair in Cheetah and in Unity, where the hair has disappeared, to this message. I’ve also experimented with other node parent child relations between the meshes than shown in the Cheetah picture (for example common folder node as parent, which has body mesh, hair mesh and joint structure as children) but the hair either disappears or the meshes get severely distorted. I’ve mainly worked with .jas files in the Unity project.
Any hints or probably a different way to reach our goal would be appreciated!
I have a turkish soldier running around my harddrive that has a hat, and I’ll explain how I got that to work -it might help.
Bind the skeleton to the mesh as normal, then when weighting, make sure the bone in the head has absolute influence, so the head doesnt twist or stretch.( Its a skull after all.) then parent (not bind) the hat/hair onto the bone of the head. Ive done this for dynamic eyeballs and it works fine too.
Hope that helps, it works fine for me. With the Makaukau character I did a while back I think I did similar and the hair had 3 bones in it and it worked fine.
HTH
Hey your work looks great, maybe you could let Martin have a screen shot for his gallery?
Thanks Targos! For example the hair object seems to work with this method. Any ideas how to circumvent the bone problems with objects that need to deform with the body, such as trousers?
I’ve only got ideas unfortunately, not definate solutions.
What about
Trousers that are parts, like a groin area, two seperate thigh pieces and two lower leg bits, and use the parenting technique. I think its either that or
Totally new skins and rigs. Ive never tried binding two meshes to 1 skeleton and have no idea if its possible.
What might be possible is a trouser model with bones and you use scripting to get the transforms to match the naked figure transforms, like this:
var character: Transform;
function Update () {
transform.position= character.transform.position;
transform.rotation= character.transform.rotation;
}
If you had legs with 5 bones, and trousers with 5 bones, put this script on each trouser bone and assign the relevant transform in the inspector. I’m making this up as I go, so I dont know if it will work. It might only work if the trouser bones arent actually connected as a hieracy, because I see a problem with the parent movements fighting with the children ones.
Another idea. The same skeleton in every garment. use one animation to drive say a walk cycle in the trousers, the shirt and the character. Then use the above script on the shirt root joint, and map it to the character root joint. Then map the trouser root joint to the character root joint, and call the same animation on all 3 skeletons which are all in the same 3d space. I imagine it might be a little cpu expensive this way, but we’re brainstorming, right?
If the character gets setup in one window, say rotating on a platform, then actually plays the game later, you could have premade models to match the setup room, for the best perfromance.
Does anyone else have any ideas?
Keep us posted on progress, huh? You might get some good ideas on the cheetah forum too.
AC
Another thought I had was similar to 3 above, but map the trouser root transform.position to the root of the character, and map the rest of the trouser bone transform.rotations to the rotations of the characters legs. That might get around the parent child fighting I anticipated.
A “simple” solution is to incorporate all the relevant meshes in the model, rigged to its skeleton, etc. and just turn on/off the bits you want at any given time.
AFAIK the only cost is that the model is being loaded in every relevant scene (but assuming a given sub-mesh is switched off in every instance, it won’t hit the video card).
Podperson: could you elaborate the “incorporate all the relevant meshes in the model, rigged to its skeleton”? How do you do that in Cheetah3D in more detail, how do you structure the different parts? Do you have a body mesh, whose children are the other meshes (as in my figure in the post) and then the same skeleton is attached both to the parent and the submeshes? Do you use simple parenting beween the items?
I just seem to explode the model various ways with this type of setup when I attach the same skeleton to multiple meshes (see figure).