Robes:Tutorial
From NWN1 Custom Content Guide
(Redirected from Robes)
[edit] Making Robes with NWMax 0.5 for fun and profit (well mostly fun)
| Image:Robe00.jpg | Robes in NWN are really another 'creature' that is overlayed on top of the PC and mimics all of their movements. If you look really close, sometimes you can see the the non-robe covered parts (often the neck+head) end up not in sync with the robe's animations, at least until you move again and cause it to resync their timing. A pretty ingenious system, and you can do some pretty funky stuff with it.
This tutorial will cover the step by step process I used to make the elven chain as depicted here, as well as using the automatic robe scaler in NWMax v0.5. Model and texture your robe as you would normally, paying attention to several details:
To our left we have the female elven chain, modeled by ThriKreen and textured by NexusJnr. |
[edit] Setup
- Now, you're going to need to set up your skeleton. You can import one from an existing robe (i.e. female elf robe 3 = pfe0_robe003.mdl), or make your own. We'll get into a custom right now, since you usually won't have to touch anything if you used an existing skeleton.
Image:Robe01.jpg
- Removing the robe itself, you will notice several things:
Image:Robe02.jpg
- The bones have a trimesh modifier with Shadow=Yes and Render=No. It's so the bones will not show up in the game, but still cast shadows.
- The leg bones are pretty FAT. Since skinmeshs do not cast shadows, you set the bones to (unless you want a ghostly effect). And since the bottom of the robe is pretty wide, you make the leg bones wide as well to match it.
- Now, if you had a robe that conformed to the robe003 model, you can skip this next part. If you compared the female elven chain to the current skeleton, you'd notice that the legs don't match, we're missing the feet and hand bones, and the skeleton doesn't have the feet on the ground!
Image:Robe03.jpg
- So what do we do? Well, we can just import the a_elff.mdl file, but it has all sorts of weapons and stuff in it and is also flat on the ground. One of the female elf NPC's might work, it is raised up, but you'd have to import it in, then replace the body parts with the naked ones since they have the armoured body parts. Luckily NWMax has the naked models of all races, genders and phenotypes sitting in your '(g)max/scripts/nwmax/manakins/' directory, so just merge the .MAX file and away you go.
- I'm not quite sure why the other models are elevated (look at some of the halfling ones), but I guess it has to do with the scale factor and the placement of the root dummy.
- OK, so we have the skeleton and the robe, with hands and feet. We'll raise the robe so they have matching heights.
Image:Robe04.jpg
- Now, my model was done in multiple segments, so we'll attach all the body parts of the elven chain robe into one object. Depending on the needs of your model, you might opt to separate some parts for other uses - in this case, the ends of the chain skirt and by the elbows so we can apply dangly mesh to them instead (sorry no jiggly boobs for this!). I'm not quite sure on the benefits of having one skinmesh over multiple, other than just data overhead - it has to deform the same number of verticies regardless of how many objects. However, for this I opted to have 3 objects to skinmesh, the main torso+arms, and the legs (since the legs overlap a lot of verticies, they'll be a pain in the **** to paint the weights).
Image:Robe05.jpg
- Remember, the skirt part along the legs is pretty large, and NWN backface culls the models, so we need to have the skirt doublesided. We'll have to duplicate the necessary portions of the skirt and flip the normals (the direction the poly's face is facing). Don't forget to do the same for the DanglyMesh objects at the bottom too! The elbow objects can be skipped since it's very unlikely you'll ever need to go that close.
Image:Robe06.jpg
- To reduce the complexity of all these objects flying around, we'll attach the interior and exterior objects together, but remember to NOT merge the verticies too. And we have the final object list of the main body and 2 legs to skinmesh, and 2 arm and 2 skirts to danglymesh.
Image:Robe07.jpg
- Like I mentioned earlier, robes are skinmeshed creatures overlaid on top of the character, which means in order for it to mimic the movements, we need to supermodel it. Go to the model base and add in the supermodel - in this case, *pfe0* (player, female elf, skinny phenotype).
- And we'll also name the model itself, following the same naming convention that Bioware implemented: since it is the skinny female elf, it'll start off as pfe0_, it's a robe, so pfe0_robe, and then the robe index - Bioware has reserved ids 0 to 24. Since batinthehat has #25 for his samurai robe, and Bigfoot has got #26 for his alienist robe, we'll make ours 27. Final name: pfe0_robe027
- We'll also parent the non-skinmeshed objects to the appropriate bones and apply the Flex modifier to them. How to assign dangly values and assign the flex weights will be covered in another section (since this focuses on skinmesh).
- You will also note that the skinmeshed objects are parented to the model base, NOT to say, the root dummy. This is because of the skinmesh system - the bones affect the verticies of the 'skin', so we don't want the skin itself to start moving around because it will inherit the transforms of the parent object and it will start shifting around all over the place.
- Another thing you'd want to do is add some more objects to fake casting shadows - since the top part of the skirt is skinmeshed, it won't cast shadows, but it would look odd when the bottom part of the skirt does - so we'll make a plane on either leg (duplicating the elven chain and using the skirt polys works, remember to separate it for left and right), parent it to the thighs, and trimesh it to Render=No and Shadow=Yes.
Image:Robe08.jpg
OK, that's it for general setup, now for the fun part - applying the skinmesh and adjusting the weights!
Part 2 : Robes:Skinmeshing
