Jump to content

How to get Head Nif R.G.B?


pxd2050

Recommended Posts

I'm making a hair color mod, and I don't know how to get HairTintColor G.R.B value(head.nif). Who can help?

3 single values, not unite RGB values.

or how to get correct HairTintColor RGB in game (not of nif file).

 

 

Edited by pxd2050
Link to comment
Share on other sites

I try to use NiOverride function, but it only get the uniform RGB value. When the r.g.b value is greater than 1, it is invalid (get wrong value), so I need to get the r.b.g value separately.

But I don't know how to get it? It is hard for me to make a dll to do it.

Function HairColor(Actor ActorRef)
		ActorBase ActorB = ActorRef.GetActorBase()
		int hp = ActorB.GetIndexOfHeadPartByType(3)
		string hpname = ActorB.GetNthHeadPart(hp).GetPartName()
		int HairTintColor = NiOverride.GetNodePropertyInt(ActorRef,false,hpname,7,-1)
		int Red = GetRed(HairTintColor)
		int Green = GetGreen(HairTintColor)
		int Blue = GetBlue(HairTintColor)
		int color = (65536*Red + 256*Green + Blue)/2
		ColorForm haircolor = ActorB.GetHairColor()
		haircolor.setcolor(Color)
		debug.notification("GetRed:"+ haircolor.GetRed())
		debug.notification("GetGreen:"+ haircolor.GetGreen())
		debug.notification("GetBlue:"+ haircolor.GetBlue())
		ActorB.SetHairColor(haircolor)
		ActorRef.QueueNiNodeUpdate()
EndFunction

When r.g.b value < 1,this code do work.

When 1=< r.g.b value =< 2, it don't work.

Edited by pxd2050
Link to comment
Share on other sites

  • Recently Browsing   0 members

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