Jump to content

Converting Wigs to Hair


cobme

Recommended Posts

Hello! I wish to convert several wig meshes to have them act as hair in my game, I'm sorry if this was explained in earlier\other threads but I couldn't find anything that answers my issue. 

All I came across in my search was this -  

http://www.loverslab.com/topic/20804-converting-wigs-to-hair/?do=findComment&comment=493265

 

And it did not help me much as my knowledge in modelling is very limited, and it is too succinct for someone as clueless as me (yeah I'm an utter noob).

I attached 2 meshes as an example of what I'm trying to convert into hair, I think they contain unnecessary branches and even multiples of the same hair branch but I may be wrong.

 

As to the process of the converting itself - I have no idea what to do...

I tried to simply use the meshes as they are in the CS as hair and it is invisible on my character, it may be floating because the object center is wrong, I believe. But I couldn't see it (the hair) in my game at all... 

braids brown.nif

kikyo brown.nif

Link to comment

    ...utter noob,eh? Well, I may not be a pro, but ive got some ideas.

 

    first , get nifskope, if you haven't already, a wonderful easy to use tool for any level of modder

 

open up the mesh with it, click on the hair,

 

file> export>export .obj ,

 

open another mesh (preferably one with a scene root, heck open a hair mesh just to be sure) delete everything but the scene root,

 

click on the scene root,

 

File import>import object> the one you just made,

 

go back to original mesh>select the hair> click the arrow next to it> go down to texturingProperty> right click copy branch

 

go to new mesh>right click on the hair> paste branch

 

right click on new hair> transform>edit (use this to move the mesh around by changing the numbers so that it lines up with other hairs... actualy maybe you may want to paste some hair that is properly placed back into scene root, to use as example before deleting it when your done)

 

x out of edit> right click your new hair> apply

 

save with a new name

 

don't get intimidated, it's easier than I make it sound.

a few tips:

1. when you ckick the arrow next to scene root to collapse it and see other things those arnt properly pasted in and wont show up in game

2. I think making colorable Hair is more difficult than it sounds, best not get your hopes up

3. search up conformulator on nexus to help you have hair that conforms to head shape

4. change materialProperty's name to hair for added shine

5. oh you may want to also copy in old mesh's alpha property into your new hair

6. not sure how well hair with multiple pieces work

 

I hope this was useful.

Link to comment

Hmm Okay I tried your instructions. The problem is the hair nifs contains several branches\blocks\meshes. Still, I tried to follow your instructions only with repeating the export\import stage with several times in accordance to the number of branches there are in every mesh in a nif and saved the nif, when I tried it in-game, the game crashed.

 

Do I need to use egm files as well? Or is it okay to discard them?

Link to comment

tolerance  your solution might work   but not for all races !!!!

 

it might cause clipping and gaps, smaller or bigger head .    because hair files need    file.egt  and   file.tri   .

 

i would advice using blender with   Conformulateur  ( it would create the egt and tri files )

 

type in Google  "conformulateur"  it will link you to nexus site with all instructions.

Link to comment

This is what I would do:

 

Have hair mesh in nifskope

Open Blender

Import a skeleton, then import a head and an upperbody part to attach to it

Import the hair

Notice how the hair is now at the feet of the whole thing. That's because hair isn't "rigged"

take the hair model and adjust it so it fits the head

Merge head and upperbody meshes

Copy bonewheight from body to hair

(The really tricky part is having correct rigging in wigs, another option is to copy only the head's rigging into the head so the only bone that "moves" the hair is "head")

Parent hair to skeleton (ctrl+p)

Delete body mesh

Have only hair and skeleton

Export

Wig is now rigged and treated as a helmet

 

You can live with a helmet without tri and egm

 

But it you need head morph, use conformulator. just make sure the whole wig is only ONE mesh. Shouldn't be hard as hairs already do not tolerate more than one

 

Link to comment

when I tried it in-game, the game crashed.

 

Do I need to use egm files as well?

 

That's the crucial point. The game as well as the CS immediately crash when processing a character equipped with such an element without an associated egm file. Any element of the head, more specificly: Eyes, eyelashes, mouth, teeth, ears, hair... One of my first race mods ever had egm-less ears included and for a while I couldn't figure out why this race was crashing the game.

 

As ElAlquimista has pointed out, to be able to use the 'Conformulator' tool for the creation of an egm file, a Nif needs to be one single mesh. Unfortunately most wigs consist of several branches, so they must be merged in Blender before attempting the conformulation process.

Link to comment

And this is the part were I play the "bad guy" that tells you that converting wigs to hairs is a very tiresome process and a really REALLY bad idea.

 

And now I will tell you why:

 

NiAlphaProperty, this property controls the alpha (controls the transparency in the textures) in the meshes, by default Oblivion has very serious issues with alpha and hairs, you can make the hair look smooth and in return it will have serious issues with everything else that also has a alpha property (when the hair overlaps a mesh that also has alpha property, parts of that mesh will become invisible), tweak the alpha values to get rid of those issues and in return you get a very jagged looking hair; this is why wigs generally have multiple branches, by duplicating the hair branch and assigning different alpha property values to each of these branches you can have smooth looking hair without the issues I mentioned above (to an extent), plus you get a rigged hair that barely clips.

 

If you still want to convert the wig to a hair...

 

Let's do a small test...

 

- Grab the braids wig you attached on the first post

- Open it with Nifskope

- Now delete one of the branches and see how it looks

- Then re-open the file, delete the other branch and see how it looks 

 

Amazing, isn't it? if you delete one branch, you get a very jagged hair, if you delete the other you get a smooth hair but with lots of gaps (alpha overlapping) in it, keep in mind that hairs only support one branch. (by tweaking the alpha values you can get in-between "not that bad" results)

 

Is there a solution to this?

 

Oh there is...remember when I said "very tiresome process"?...get ready for alpha layer re-ordering (better explained here), I'm no expert in this as I usually run from it like the plague, but in simple words, you have to dismantle the hair into small parts in Blender, then get them back into a single mesh following a certain order, this can range from a very simple process to a complete nightmare depending on how complex the hair is.

 

Short story, do not convert wigs to hairs unless you want to either get a half-assed work or to go trough a nightmare inducing process to get something that actually looks good in the end.

Link to comment

Very good - you have explained the issues and inevitable drawbacks in painstaking detail! Before I wasn't aware of the principles behind the visual glitches from overlapping alpha transparencies.

 

This reminds me of a conversation I recently had with Fejeena about including wigs in the mod I am working on: So one of the main advantages to use wigs for certain characters is to reduce the alpha overlay glitch in case these NPCs' outfits also have an alpha channel transparency? Keeping this in mind will help me with the distribution of wigs and outfits to the characters; that's a better solution than simply using short hairstyles all the time to prevent the hair from overlapping any part of the clothes.

Link to comment

 

 

As for the outfits with alpha, you can follow the wig's logic to keep them almost alpha issues free.

 

I know for a fact that the Alpha values at Flags : 4844 Threshold: 200 makes all the overlapping alpha issues simply go away, however it will look really jagged, this works very well for ragged/torn clothing and everything in the same kind, if you need something smoother, then duplicating the branch and setting it's values to Flags: 4845 Threshold: (value varies with meshes) should solve the problem in most cases, I've had just one or two cases where none of the above worked.

Link to comment

Sorry, merging a head mesh with anything will not work because of associated morph files.

But seems like Tolerance's solution in the second post will work. Just make sure to conformulate it afterward as Kingkong said.

I think simply copying and pasting the trigeom branch from a wig nif (after removing its skininstance branch) would do the same with exporting & importing .obj. But I haven't tried this one myself.

Link to comment

Speaking of hairs...

 

I tried to make a totally new hair using another hair's sims texture...

It's rudimentary but it serves it's purpose, I guess...

 

Problem is from the very beginning the alphas were wrong

Adjusting values in nifskope made for something wearable, but lacking that smooth aspect a perfect hair has (pics later)

 

On another experiment, I tried that hair layer to tweak a conversion... made another decent but not perfect result (pics also later)

 

Conclusion:

Something is messed about the alphas when using Blender. (Obvious at this point isn't it?)

 

But here it comes...

 

Does anybody know if it's a blender issue only? Or it happens all the same when using 3dsmax or other stuff?

I mean... there HAS to be a way to make a model with perfect alphas, or we wouldn't have any decent hair at all right?

And we do. Lots of Sims conversions for both Oblivion and Skyrim have hair without alpha issues

Somebody must have gotten it right at some point.

Link to comment

Read the post number 7 by Risray, and follow the tutorial link there.

The tutorial contains some incorrect informations because of the author's ignorance. But it should get you somewhere.

I did.

What I meant is that Risray himself said the layer order process is so tedious it scares the living crap out of him.

And frankly, me too.

 

Considering the enormous amount of available hairstyles we got... that can't be it can it?

It doesn't seem to make sense that so many people would go through such a tedious process, so many times in so little time to create so many mods.

It also doesn't make much sense that so many "unknown" modders even know the process.

 

If only they would talk to us. How did they do it? I.E Is the guy who made SKS hair or the SG hair pack for Skyrim even around somewhere?

Is it really the only way?

I've been meaning to try the process with another software in case Blender is the reason.

Theorizing perhaps something like 3dsMax doesn't have that issue (???)... but I still don't know how to use it.

Link to comment

Blender completely destroys the layer order upon importing the hair's nif/obj/etc... dunno if 3dsMax has the same issue.

 

You can always try to contact Lucha (at Nexus or TesAdventures) or Max/Dustinflan (don't remember which of these two made the hair packs), they sure know a lot about hairs/wigs.

 

Note: Hairs for Skyrim work like the wigs for Oblivion, just that instead of two branches in the same nif, you have two separate nifs, hair and hairline, at least this is how the SG hair pack works.

Link to comment

You can try other softwares. 3ds is free for non-commercial individual users. But you won't simply get away from this vertex order crap. There are several ways of sorting vert order, but you can't create one without doing any of them. Really, Blender is not the one to blame.

 

Nifscript from Niftools destroys vertex order around the UV seam lines on import/export. And this transparency disaster happens. That is what you get when you import and export hair/head nif files without any trick.

So why the script has to destroy vert order. Apparently NIF format allows only one UV coordinate set for one given vertex. However, UV seam vertices can potentially have two or more UV coordinates. This is the problem. What nifscript does is to make duplicate vertices at the same position to preserve multiple UV coordinates (with identical loc, normals, weights, ...) And.. they are merged again on import. This explains why vert order is a bit (not a lot) messed up on each import process.

You can kind of avoid this problem by using Gerra's tweaked nifscript.

 

However, as you are trying to create a new hair mesh from scratch, you'll anyway have to sort the faces at some point even if you manage to preserve vert order. I mean, at least once. You then said that you wonder how in oblivion could there be so many hair meshes out there... They were processed like this. They all were. Not because those modders had some fancy magic, but because they all spent countless hours and efforts just like you sculpt your models so carefully. Fame does not measure the ability they have or the amount of effort they put in.

 

Now to talk about something that actually helps... this face sorting work still scares out of me, but I do not hesitate when I only have one hair mesh. Two, three, even five, that's still ok. But I say this work is horrible because my main concern was handling craploads of hair resources. But you are not, which is good. Depending on the complexity of the mesh, it may take only 10 minutes or may take one whole hour. I'm pretty sure you won't mind this small amount time as creating a hair from scratch will most certainly take much more than 1 hour.

 

As to the problem that if it is the only way or not... Yeah, I think this process can be automated. But I haven't given thoughts on it too seriously.

Link to comment

Here's my nifscripts modification for preserving vertex indices when importing nifs into Blender 2.49b.

 

It's fairly basic, just disables the method that nifscripts uses to detect vertex doubles, which prevents it from purging them on import.

 

Just replace the existing import_nif.py file in your \.blender\scripts\import\ folder with the one in the attached zip.

import_nif.7z

Link to comment

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