Jump to content

Converting a hair to rigged wig, in Oblivion


movomo

Recommended Posts

Long ago I decided to write a guide of creating wigs, but was too lazy to actually do it. Several months passed on sinch then, now I really feel that I have to leave something for aspiring modders and for myself.

 

Thanks to:

Apachii, GSB for kindly teaching an ignorant fool

Gerra6 for all of his assists in various ways. Especially for bone weight copy script, kindly agreed to create new wig-specific functionality by my request.

 

 

 

 

 

I'll explain this in detail as far as I can, but I assume that you're familiar to basic blender work. If you're completely new to blender, you'd better look around some basic blender tutorials. Some of my writings may be obscure because of my bad english, sorry for that.

 

 

 

 

1. First, choose an hairstyle and make it ready to be imported to blender.

 

 

01_online.JPG?async&rand=0.4260143763676

 

Open the hair file with nifskope, select the hair object, and export as obj file.

 

Currently, nifscript does not preserve the vertex order. Now what is the vert order I'm talking about?

 

Vert order is - what else? - verts' order. At some binary level of view, when you create something, anything, all the vertices are stored as a large array. The first entry(0) of the array would be the first vertex you create. The next entry is the second, third,... and so on. Each entry has its 3D infos such as x/y/z coordinates.

You know, the hair in oblivion (as well as fallout, skyrim, and many other games) consists of many number of textured layer meshes. The game engine renders those layers in order of their created date, their 'age'.

 

So what if our hair file forgot its vert order and confuses Oblivion? Bad thing happens, transparent part of the upper layer will veil the lower/inner layers' visible part, resulting a crappy cluster of textures looking like shit. Every 'working' hair in Oblivion modding world should face this issue. There are several ways to 'reset' the vert order of an object, but don't expect it would be easy. It indeed is a brambly way full of agony and patience.

 

So export as obj, do not import directly as nif, unless you want to step into the dark art of hair modelling.

 

 

 

2. Growlf's Rigging Machine

 

 

02_online.JPG?async&rand=0.3766826944272

 

Probably you already have this. This is famous blender riggin machine. Most time ( I mean when you weight some armor or skirt or...) you don't need this, but wigs are somewhat special. Critical bones for wigs are Head, Neck1, Spine2, Spine1 and Spine. and sometimes pelvis or even including thigh, calf bones. but if you directly copy boneweights from the body mesh, you'll end up doing manual painting especially on the neck. And manual painting on a hair is a simple horror because of clustered layers. You can hardly use brush but editing weight values individually or using some weightpainting scripts.

 

Import it, now we're ready.

 

 

 

3. Importing the obj

 

 

03_online.JPG?async&rand=0.7142101195915

 

This is the importing option. Uncheck -x90 option otherwise you'll have to turn the imported object by 90 degree again, not important anyway.

 

 

 

4. Some adjustment

 

 

04_online.JPG?async&rand=0.4747823988549

 

Set Smooth: imported object fresh out of obj file is solid. set smooth.

Double Sided:

GENERALLY, most of hairs are single sided. They are just stacked two same layers that one of them is heading outside and the other is heading the inner side. So you may want to uncheck this option most of the times.

THIS TIME, we're dealing with a Final Fantasy hair. some ported hairs have NiStencilProperty. In this case, we just leave it alone.

 

Now you'll see the hair is on the ground position. Let's move it to the proper position.

 

Z: +11.2441 (this is the basic height of humanoids in oblivion. It's 112.441 but scaled by 10 times in blender)

Y: -0.1187

 

05_online.JPG?async&rand=0.3077156459698

Looks fine. You can use those translating factors on just about any oblivion hairs.

But in case that you're converting other hairs such as skyrim, fallout, or other, just move it as you see fit.

 

06_online.JPG?async&rand=0.2647536956794

Hit the Center Cursor button to apply new orientation.

 

 

 

5. Bone Weight Copying

 

 

This time we'll use the 'WigMachine2' object as the copy source. Transform it if you want, if you've never tried BWC before just leave it alone. I'm upscaling by 1.4 along the z axis.

07_online.JPG?async&rand=0.0764200749079

08_online.JPG?async&rand=0.1001608610341

 

Now, copy the bone weight.

Seriously, use Bone Weight Copy script 2.5 by gerra.

http://www.loverslab.com/topic/11841-blender-bone-weight-copy-script-23a/

It's lightning fast and yields much better copied weight quality.

 

09_online.JPG?async&rand=0.0809919467089

'Magnify Bone Weights' option is the wig-specific one I was talking about. You can use this option to adjust the magnitued of each copied vertex group, for example, 1 for head and 0.8 for neck1 and 0.6 for spine2 ... Well not necessarily needed anyway.

 

10_online.JPG?async&rand=0.4096222138493

And the result.

Paint manually if you don't like the result.

 

11_online.JPG?async&rand=0.1046976227560

Optionally, add an armature modifier for test purpose. This process has nothing to do with your final product.

 

12_online.JPG?async&rand=0.1489523083846

13_online.JPG?async&rand=0.7743010312515

Enable 'Xray' and 'Name' for the skeleton, and move it in the pose mode to see if weightpainting is good or gone postal.

 

 

 

6. Before Export

 

 

14_online.JPG?async&rand=0.0205865301385

Additionally, I have separated the 'accessory' part to enable HILIGHT texturing in game.

 

15_online.JPG?async&rand=0.5825782809201

Don't forget to delete the second material before export. If you import an obj file, this happens. But there should be only one material per one object in oblivion.

 

16_online.JPG?async&rand=0.3401980081408

Once you're set with your edits, delete everything except the wig. And import a fresh new skeleton.

 

Now, export. Use exactly same option as when you export your armor or other gears.

 

 

 

7. Post Edit

 

 

17_online.JPG?async&rand=0.2719409179219

In nifskope, do your desired edits. This time, I've deleted NiSpecularProperty (cuz it has no effect on the object with normal map) and changed material colors, glossiness.

 

Lastly, take a look at the alpha property. You see 'Threshold' value? With this setting you can control how much your hair will be visible or not, between 0 to 255. Some example:

 

18_online.JPG?async&rand=0.6016849508768

With 0 threshold.

19_online.JPG?async&rand=0.4691160053653

With 160 threshold.

 

You must test this in game at least once, as the look of the wig in game may be different from that of nifskope. The same rule applies to anything that has an alpha channel.

 

For x117 fellas, you need to scale them again.

Oblivion_2013-07-27_02-23-26-4.jpg?async

Doesn't look bad huh.

Humanoids' height in oblivion is 112.441 as I mentioned above. So, *in theory*, you can calculate the amount to be translated from the z scale factor you've used. For example, I scaled x/y/z 1.17 , so how much I should move it down to fit the head? 0.17 times of 112.441 is 19.11497. So I translate -19.115 along the z axis, and some minor adjustments, the picture above is -20 z.

This formula is generally acceptable for many hairs but as you've just seen, sometimes you need to apply different values for individual hair. Use this formula as a starting point.

 

 

 

If you upload your super duper mod don't forget to put some equipable ears as well. Have fun.

Link to comment
  • 2 months later...

I've realized that I made a mistake that not mentioning about how to sort transparent layers. So here you go.

Fortunately enough not too many people have read this tutorial so far.

 

The important point is that weightpainting process seems always mess up everything. I'm not entirely certain how much it affects on the vert order.

But almost all items in my x117 wig pack has this issue.. it's just a matter of how severe it is. I was aware of it but didn't try to fix them as I was too lazy to fix everything myself.

 

Anyways, I'm gonna show you a few pics to describe how to sort rendering priority and why you have to do so.

 

This is the problem.

01_before_import.JPG?lgfp=3000

As you see, outer layers of the hair is veiling other layers behind. (Nifskope)

 

 

02_after_import.JPG?lgfp=3000

 

This picture was taken in Blender, not Nifskkoope. You can still see there is a problem. We'll fix this ugly one.

 

03_weight.JPG?lgfp=3000

 

Fitstly make your all other edits. Especially don't forget to weightpaint before you begin sorting.

Another important note, some custom hairs have NiStencilProperty. Usually you can find it in hair meshes with very high poly count. This is not a good idea however, I'll explain why.

 

Sketch8295437.jpg?lgfp=3000

 

This is how separate transparent layers take precedence.

Think about you copy a vertex. The original vert and the copied vert all look same, but not exactly same - because the copied vertex is younger. We can call this the vertex order.

Let me put it like this: Older vertices will get priority. If outermost layer is the oldest one, bad thing happens. Some part of the inner layers (usually where alpha channel is not explicitly black/white) won'e be visible.

 

So what we do now is, peeling every single layer in the hair one by one.

This is a pain in the ass on its own..

 

04_peeling.JPG?lgfp=3000

 

Like an onion.

First the outermost layer, next the second outermost one, and the next, ... and the innermost layer last. (or in the other way around, your call)

Move layers by some simple numbers. Move the fist layer X -2, the next X-4, the next X-6 ... so you won't forget where it was when you put it back.

 

Saving at this point is a good idea here.

 

Now we have to handle inward/outward layers a bit differently. 'Inward' refers to layers that are NOT visible when looking from the outside. 'Outward' layers are what you usually see in game.

 

Sketch8210038.jpg?lgfp=3000

 

This is why having double-sided mesh in a hair file isn't a good idea. 'Inward' and 'outward' layers should have opposite rendering priority. Instead, we duplicate a single-sided layer and flip its normals to render both side of hair.

 

From here, copy every last layer back to its original place. This is a loyal pain again. Try to maintain your sanity.

 

After a long time of working, you should be able to see the change in Blender:

05_sorting.JPG?lgfp=3000

 

And in Nifskope:

 

06_final.JPG?lgfp=3000

 

Compare these two images to the first two. Now it definitely looks better.

 

As you can see this work is agony and every time you weight your mesh again you need to do this again.

 

Well, it's too fast to give up all hope.

When a hair doesn't look like shit too much you can adjust the threshold value of NiAlphaProperty.

At least, you don't *always* need to rework every last bit of layers in the object. Most times just rework only outer layers,, that should be decent.

 

 

 

Link to comment

It should be noted, if you allow me, that some meshes may still have transparency issues after reordering verts on a rigged hairmesh. Seems like hair, rigged to only one bone (head) blends alpha ok, but if you make a long hair with rigging to spine bones, some of the strands can be screwed whatever you do, they won't blend normaly. The solution is to detach them from the mesh and to parent to it, then everything will work quite fine.

Link to comment
  • 5 months later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use