Jump to content

How to make KS Wigs use facegen hair colour?


Recommended Posts

Posted

I've been trying to figure out how to make the wigs from HDT-SMP KS Hairs match NPCs' own hair colour.  I found a post about how to do the opposite, and it suggests setting:

bEnableTintHairSlot=0 ; Default[1]

in the skee64.ini file.  This should confirm that what I want to do is at least possible in principle.  I would have thought that'd mean setting that value to "1" would thus give the behaviour I seek, but it doesn't.  So, I don't really know what I'm talking about with this stuff, but I'd guess I need to change something in the meshes for the wigs with Nifskope?  

 

Any guidance you folks can provide would be much appreciated.  

Posted

NiTriShape

BSLighningShaderProperty

Skyrim Shader Type -> right click

select from scroll menu Hair tint

 

Posted
5 hours ago, Antiope_Apollonia said:

I've been trying to figure out how to make the wigs from HDT-SMP KS Hairs match NPCs' own hair colour.  I found a post about how to do the opposite, and it suggests setting:

bEnableTintHairSlot=0 ; Default[1]

in the skee64.ini file.  This should confirm that what I want to do is at least possible in principle.  I would have thought that'd mean setting that value to "1" would thus give the behaviour I seek, but it doesn't.  So, I don't really know what I'm talking about with this stuff, but I'd guess I need to change something in the meshes for the wigs with Nifskope?  

 

Any guidance you folks can provide would be much appreciated.  

 

The shader settings in nifskope only change how the game renders the textures applied to that mesh. It isn't some magic process that copies the color of the shader type. Choosing hair tint won't make the wig hair colored, nor will the skin tint make it skin colored. You would need an esp and scripts to get the RGB values of the hair color and then copy it to the wig. The mod you linked on nexus has these scripts if you want an example. There are some 3D pubic hair mods on LL that also have color matching, I know OsmelMC made one.

 

If that seems like too much work, you can go to the wig mod on nexus and click on the requirements tab. It should list all of the other mods that require the wig mod, maybe someone already made a color matcher. 

Posted
3 hours ago, bnub345 said:

The shader settings in nifskope only change how the game renders the textures applied to that mesh. It isn't some magic process that copies the color of the shader type. Choosing hair tint won't make the wig hair colored, nor will the skin tint make it skin colored.

Hm.  That's what I'd have assumed, but when I was looking into my options, I found a number of people claiming to have the "problem" of certain wigs automatically matching hair colour when they didn't want them to, and looking for solutions to make it not do so, so it gave the impression that there should be a way to achieve that behaviour.  

 

3 hours ago, bnub345 said:

You would need an esp and scripts to get the RGB values of the hair color and then copy it to the wig.

Can I just set the RGB manually?  Where is that data located?  I guess that'd be the same as changing the colour of a piece of armour or clothing?  That's something I've been wanting to learn to do for a while, anyway.

Posted
4 hours ago, Tlam99 said:

NiTriShape

BSLighningShaderProperty

Skyrim Shader Type -> right click

select from scroll menu Hair tint

Sorry if I'm just ignorantly missing something obvious, but I don't seem to have an option for NiTriShape.  Here's what I see:

Spoiler

Clipboard01.jpg.6df1107f923d44955d642427eec43279.jpg

My experience using NifSkope is pretty much limited to making meshes slot-neutral so I can edit equip slots in xEdit, so I don't really know what I'm doing here, lol.

Posted
48 minutes ago, Antiope_Apollonia said:

Hm.  That's what I'd have assumed, but when I was looking into my options, I found a number of people claiming to have the "problem" of certain wigs automatically matching hair colour when they didn't want them to, and looking for solutions to make it not do so, so it gave the impression that there should be a way to achieve that behaviour.  

 

Can I just set the RGB manually?  Where is that data located?  I guess that'd be the same as changing the colour of a piece of armour or clothing?  That's something I've been wanting to learn to do for a while, anyway.

 

  • That post was people using the mod that changes hair colors, by removing the hair tint shader the wigs reverted to their default color.
  • You set the color manually in nifskope by selecting the BSLightingShaderProperty of the wig and going to the hair tint color at the bottom.
  • In your screen, the BSLightingShaderProperty is attached to the BSTriShape of the wig parts KSSMP_Desirae and KSSMP_Desirae_HL.

You could just make some wigs using the default 12 hair colors and manually match them up to the NPCs. 

Posted

Please forgive the depth of my ignorance here.  I've only scratched the very surface of this area of modding up 'till now, so I fear I may be about to embark on a bunch of rather tedious questions.  Thanks in advance for your patience with me!

 

On 4/5/2022 at 5:54 AM, bnub345 said:

the wig parts KSSMP_Desirae and KSSMP_Desirae_HL

Can you explain the relationships between all the different .nif files in play here?  Aside from anything I might have missed, there are at least five relevant files in three relevant directories:

\Data\CalienteTools\BodySlide\ShapeData\KS Wigs SMP\CBBE

contains Desirae.nif

\Data\meshes\KS Hairdo's\HDT

contains Desirae.nif and DesiraeHL.nif, and

Data\meshes\armor\KSWigsHDT\f

contains Desirae_0.nif and Desirae_1.nif

 

I can't see a difference among the pairs of files located in the same directories.  The files sizes are the same, and looking them over in NifSkope, no immediately obvious differences pop out.  I've always wondered about this whenever I've dipped my toe into this stuff in the past, so now seems like time to finally understand it.  

 

I understand the second directory to be the hairstyle itself and the third to be the wigs, but interestingly, it looks like the wigs have references to the hairstyles:

Spoiler

Clipboard01.jpg.35aa3c183bf49c0bb187d9bb8f193dfc.jpg

 

So, in general, I'd really like to develop some kind of basic working conceptual model of what's going on here, so to speak.  But also, to the end at hand, I need to figure out which file I should be editing.  

 

On 4/5/2022 at 5:54 AM, bnub345 said:

In your screen, the BSLightingShaderProperty is attached to the BSTriShape of the wig parts

This may already be contained in the answer to the previous questions, but most of these files contain two separate records (do we call them "records" in NifSkope like we do in xEdit? lol) for BSTriShape, each of which has the BSLightingShaderProperty daughter:

Spoiler

Clipboard01.jpg.0a52ecff15326ef2e28747c9625449d5.jpg

Should I be editing line 43 or 50?  Or both?

 

Beyond that, the RGB values for all the Hair Tint Color properties in all the files appear to just be 1,1,1.  Which should be black.  But in game, the wigs are all sort of chestnut brown:

Spoiler

ScreenShot122.png.f3e4112cdfdb8cf2d7a79012ae98fa67.png

So I feel like something else must be going on here, no?

 

On 4/5/2022 at 5:54 AM, bnub345 said:

You could just make some wigs using the default 12 hair colors and manually match them up to the NPCs. 

Well, at the minute, I'm only trying to work with two NPCs—my two followers; Mistress and playmate—so I'd prefer a more finely-tuned solution to one more easily implemented en masse.  But that does sound like a good idea for something to have in my back pocket.  If I knew how to do that, I might be braver to take on more ambitious HDT-ification projects, so if you don't mind educating me on how I'd do that, I'm an eager student!

Posted
4 minutes ago, Antiope_Apollonia said:

\Data\CalienteTools\BodySlide\ShapeData\KS Wigs SMP\CBBE

 

This contains a mesh with slider data attached that can be used in bodyslide.

 

5 minutes ago, Antiope_Apollonia said:

\Data\meshes\KS Hairdo's\HDT

 

This is where the meshes are for the hairstyle.

 

6 minutes ago, Antiope_Apollonia said:

Data\meshes\armor\KSWigsHDT\f

 

This contains the meshes for the wigs.

 

When looking at KS hair meshes, they generally come in two or more parts. One part is the hairline (HL), which generally has a high alpha threshold, i.e. you can partially see through it. The other part is the main hair mesh, which is generally opaque. In the CK/Esp, hairs have a main head part, the hair mesh, and addon head parts, the hairline mesh(es). These parts are layered together to create the hair you see in game. So if you want to change the hair, you need to do the same exact edits to the Hair and Hair_HL parts. 

 

When meshes have a _0 and _1 at the end of their name, that means they are configured to match 0 and 100 weight on actors, respectively. Through bodyslide magic, these two meshes can be used to extrapolate a fitting mesh for an actor at any weight between 0 and 100. I'm not sure why hair would need this, as the head mesh is always the same size regardless of weight. Maybe it's to adjust hair clipping with the breasts, idk.

 

Nifs do not contain references to other nifs, everything needed for the mesh is contained within them. The wig and hair have the same parts because they are just copies of each other.

 

22 minutes ago, Antiope_Apollonia said:

Should I be editing line 43 or 50?  Or both?

 

As you can see, you will need to edit both of these. And also probably a third shader property under shape 65 at the bottom, Hairline. This is usually a base that the other hair parts are built on, like a scalp. 

 

24 minutes ago, Antiope_Apollonia said:

So I feel like something else must be going on here, no?

 

You're looking in the wrong spot. There should be three color slots on the BSLightingShaderProperty entry, Emissive Color, Specular Color and Hair Tint Color. Hair tint is the one you want, and it should be near the bottom. It's possible the wigs don't actually have a hair tint entry, I'm not positive on how they are implemented. If there is no hair tint, that means the color is set in the corresponding texture file under the BSLightingShaderProperty, BSShaderTextureSet. This should refer to a .dds file. In this case, the only way to change the wig color is to change the color of the texture. 

Posted
2 hours ago, bnub345 said:

When looking at KS hair meshes, they generally come in two or more parts. One part is the hairline (HL), which generally has a high alpha threshold, i.e. you can partially see through it. The other part is the main hair mesh, which is generally opaque. In the CK/Esp, hairs have a main head part, the hair mesh, and addon head parts, the hairline mesh(es). These parts are layered together to create the hair you see in game. So if you want to change the hair, you need to do the same exact edits to the Hair and Hair_HL parts. 

 

When meshes have a _0 and _1 at the end of their name, that means they are configured to match 0 and 100 weight on actors, respectively. Through bodyslide magic, these two meshes can be used to extrapolate a fitting mesh for an actor at any weight between 0 and 100. I'm not sure why hair would need this, as the head mesh is always the same size regardless of weight. Maybe it's to adjust hair clipping with the breasts, idk.

 

Nifs do not contain references to other nifs, everything needed for the mesh is contained within them. The wig and hair have the same parts because they are just copies of each other.

All very interesting.  Thanks for the education!

 

2 hours ago, bnub345 said:

I'm not sure why hair would need this, as the head mesh is always the same size regardless of weight. Maybe it's to adjust hair clipping with the breasts, idk.

I'm pretty sure it's about collision, but not just the breasts—also shoulders and, depending on the hair and how extreme the body, potentially even the buttocks.  I remember reading something when first setting it up about needing to build it in bodyslide for physics collision reasons, at any rate.

 

2 hours ago, bnub345 said:

As you can see, you will need to edit both of these. And also probably a third shader property under shape 65 at the bottom, Hairline. This is usually a base that the other hair parts are built on, like a scalp. 

Okay, got that.

 

2 hours ago, bnub345 said:

You're looking in the wrong spot.

But here's where we hit a spot of bother.  I'm fairly sure I wasn't looking in the wrong spot based on your subsequent explanation.

Spoiler

Clipboard01.jpg.fd1cb0f71dd0c925658db4d2ba3fd864.jpgClipboard02.jpg.88c4a3e89223f3e80d2d8981dc5b91ef.jpgClipboard03.jpg.5df72a5dca864bec40472b3396e6859a.jpg

All three of the Hair Tent Color fields have 1,1,1 RGB values, but the wig is chestnut coloured in game.  So there seems to have to be something else going on.  I decided to just try editing those values and seeing what happens.  I set all six Hair Tint Colour fields to 0,200,0 figuring that'd be maximally conspicuous.  I got a slightly darker, very slightly reddish brown.  I also tried a more normalish colour–200,110,10—to see what would happen, and I got the exact same dark, slightly reddish brown.  So I don't know what's going on here.  Am I fucking something up, or is there a confound in the process somewhere?

Posted

I assume you are using the KS SMP Hair mod on the nexus from ousnius? The wig color is not controlled by the RGB tint in the nif or the dds texture, but through racemenu scripts in the esp. It should automatically set the wigs to the same color as the NPC's hair. There may be a mismatch between the color values in the esp and the facegeom nif, but you would never notice that in game. 

 

If you are using some other mod, link it so I can try to see how it works. 

Posted
3 hours ago, bnub345 said:

I assume you are using the KS SMP Hair mod on the nexus from ousnius?

That's correct.

 

3 hours ago, bnub345 said:

The wig color is not controlled by the RGB tint in the nif or the dds texture, but through racemenu scripts in the esp. It should automatically set the wigs to the same color as the NPC's hair.

Hm.  It hadn't even occurred to me that that might be a thing, and I've had the mod for a while, so I didn't remember that in the description.  I see now that it claims that behaviour, which, if it were working for me, would be a solution, but it very clearly isn't behaving that way.  I'm getting the same chestnut brown colour from the above screenshot regardless of whether I put a wig on a blonde or a redhead or a dark brunette, PC or NPC.

 

Maybe I could remove/disable that script somehow, and it would make your previously described approach of editing the NIFs work?

Posted

Okay, I just figured out what's going on here and how to overcome it.  I don't know if I'm going to explain this in a technically accurate way, but I'll try.  Maybe @bnub345 can correct me where I say something ignorant so it's on the record for posterity—and I'll be less ignorant in the future.

 

When you choose a hair colour with Racemenu's sliders, it uses a separate system from the vanilla character creation hair colours.  And the character retains an unaltered record for "hair colour" that you can see in xEdit, which is that brown colour by default.  

 

Apparently, the KS Wigs script looks at this vanilla hair colour record, and not at the true hair colour the character gets from Racemenu.  So even though my follower is blonde, for example, she still had that HairColor09DarkBrown record, and that was determining the wig colour.  If I change that record with xEdit, so changes the wig.  

 

That offers limited colour customisation—just a dozen or so options instead of RGB—but it's a whole hell of a lot better than no customisation.  

  • 3 months later...
Posted
On 4/13/2022 at 3:50 PM, Antiope_Apollonia said:

Okay, I just figured out what's going on here and how to overcome it.  I don't know if I'm going to explain this in a technically accurate way, but I'll try.  Maybe @bnub345 can correct me where I say something ignorant so it's on the record for posterity—and I'll be less ignorant in the future.

 

When you choose a hair colour with Racemenu's sliders, it uses a separate system from the vanilla character creation hair colours.  And the character retains an unaltered record for "hair colour" that you can see in xEdit, which is that brown colour by default.  

 

Apparently, the KS Wigs script looks at this vanilla hair colour record, and not at the true hair colour the character gets from Racemenu.  So even though my follower is blonde, for example, she still had that HairColor09DarkBrown record, and that was determining the wig colour.  If I change that record with xEdit, so changes the wig.  

 

That offers limited colour customisation—just a dozen or so options instead of RGB—but it's a whole hell of a lot better than no customisation.  

could you elaborate please? i have the exact same issue with wigs just being that chestnut brown but i have never used xedit before so dont know where to start. thanks

Posted
8 hours ago, markorn55 said:

could you elaborate please? i have the exact same issue with wigs just being that chestnut brown but i have never used xedit before so dont know where to start. thanks

 

Run xEdit, open the mod that has your follower, go to the Non-Player Character (Actor) tab, and click on the entry for your follower. Scroll down on the right side of the screen until you see an entry HCLF - Hair Color. This is the entry that controls the wig color. Double click on this and pick whatever color you want. 

  • 3 months later...
Posted (edited)
On 4/13/2022 at 3:50 AM, Antiope_Apollonia said:

When you choose a hair colour with Racemenu's sliders, it uses a separate system from the vanilla character creation hair colours.  And the character retains an unaltered record for "hair colour" that you can see in xEdit, which is that brown colour by default.  

 

 

The reason why the color you see is different from the color defined on the NPC is because the face of the NPC comes pre-build on a NIF file while the player face is build on real time. 

 

Many author's make the face for the NPC usually as replacement for the original faces and forget to set the new colors on the xEdit.

 

By the way you can make new Hair Colors on the xEdit with copy the previous Hair Color into a new one and rename it (in this case I usually use the name of the actor that will be using it)

 

You can know the color settled on the NIF file using the NifScope tool but Skyrim don't have internal functions for that. So the only way is changing the Hair Color on the NPC using the Creation Kit, xEdit or the native function through the scripts. 

Is possible set the hair color of the NPC's through scripts but you won't find a Mod to do that because since the face of the NPC is pre-build with a color, change the value of the hair color by scripts don't affect the color you see on the pre-build face hair and try to force the update usually change the aparece of the face into a potato.

Edited by OsmelMC
Posted
On 4/4/2022 at 10:58 PM, Antiope_Apollonia said:

Can I just set the RGB manually?  Where is that data located?  I guess that'd be the same as changing the colour of a piece of armour or clothing?  That's something I've been wanting to learn to do for a while, anyway.

The NiOverride that comes with the RaceMenu have one function that allow you do that but also required to edit the meshes of the wigs to disable the use of the Hair Color.

  • 3 months later...
Posted
On 11/9/2022 at 3:16 AM, OsmelMC said:

 

 

The reason why the color you see is different from the color defined on the NPC is because the face of the NPC comes pre-build on a NIF file while the player face is build on real time. 

 

Many author's make the face for the NPC usually as replacement for the original faces and forget to set the new colors on the xEdit.

 

By the way you can make new Hair Colors on the xEdit with copy the previous Hair Color into a new one and rename it (in this case I usually use the name of the actor that will be using it)

 

You can know the color settled on the NIF file using the NifScope tool but Skyrim don't have internal functions for that. So the only way is changing the Hair Color on the NPC using the Creation Kit, xEdit or the native function through the scripts. 

Is possible set the hair color of the NPC's through scripts but you won't find a Mod to do that because since the face of the NPC is pre-build with a color, change the value of the hair color by scripts don't affect the color you see on the pre-build face hair and try to force the update usually change the aparece of the face into a potato.

Hate to respond to an old thread, but how exactly do I create new hair colours in xedit. I have the rgb of a hair colour id like, but the Hair Colour in xEdit uses a colour code i cant identify.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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