Jump to content

Question

Not sureif this is the right place for this or not but

 

I am trying to make a script, that can change the color of my hair ((nightmare city any of you that know about how hair is made >.>))

What I'm after is a way to tell it two colors, and have it split the prims between those two colors....not sure if this is even possible or not ,thanks in advance for taking the time to read this anyway!!!!

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 1

There are many ways to approach the problem but they will all involve having some way to address each child in the linkset (or maybe each face on each child prim) uniquely and they all assume that you have permission to modify the hair.  Without knowing exactly how the hair is constructed, it's hard to guess what approach is likely to be most pleasing.  Basically, though, the trick is to identify each thing you want colored and then step through the full set of them with a function like llSetLinkPrimitiveParamsFast, which will let you apply all changes at once.  Schematically, you'd have a horrendously long function that looks like:

llSetLinkPrimitiveParamsFast(LINK_SET,[34,Link1,PRIM_COLOR,ALL_SIDES,vColor1,1.0,34,Link2,PRIM_COLOR,ALL_SIDES,vColor2,1.0,34,Link3,PRIM_COLOR,ALL_SIDES,vColor1,1.0 ......]);

and so on, until you had identified every single link and its intended color.  The magic is in how you decide which link to apply which color to.  Only you can decide that.

As a somewhat different approach (and possibly more aesthetically appealing), I suggest thinking about changing textures on the various prims instead of changing colors.  The problem with changing colors is that they will have the same intensity and hue wherever you apply them, so you will risk having your hair look like old-style "helmet hair." If you create separate textures for each of your color variations, they can have all of the subtle shading and highlighting built into them. In the end, you'll be able to wear red hair that doesn't look like someone painted blonde hair red.

Share this post


Link to post
Share on other sites
  • 0

Well, you could put the two colors into the content tab of each of the hair prims...but name them the opposite in half the prims.  So, let's say you have a pink and a blue hair texture.  Put 'em both in every prim, but in half the prims name them:

pink=color1  blue=color2

and in the other half of the prims, name them:

pink=color2  blue=color1

Then have your script change to either "color1" or "color2".

I'm sure Rolig, our scripter queen, will come up with something more elegant.

Share this post


Link to post
Share on other sites
  • 0
11 minutes ago, Rolig Loon said:

There are many ways to approach the problem but they will all involve having some way to address each child in the linkset (or maybe each face on each child prim) uniquely and they all assume that you have permission to modify the hair.  Without knowing exactly how the hair is constructed, it's hard to guess what approach is likely to be most pleasing.  Basically, though, the trick is to identify each thing you want colored and then step through the full set of them with a function like llSetLinkPrimitiveParamsFast, which will let you apply all changes at once.  Schematically, you'd have a horrendously long function that looks like:

llSetLinkPrimitiveParamsFast(LINK_SET,[34,Link1,PRIM_COLOR,ALL_SIDES,vColor1,1.0,34,Link2,PRIM_COLOR,ALL_SIDES,vColor2,1.0,34,Link3,PRIM_COLOR,ALL_SIDES,vColor1,1.0 ......]);

and so on, until you had identified every single link and its intended color.  The magic is in how you decide which link to apply which color to.  Only you can decide that.

As a somewhat different approach (and possibly more aesthetically appealing), I suggest thinking about changing textures on the various prims instead of changing colors.  The problem with changing colors is that they will have the same intensity and hue wherever you apply them, so you will risk having your hair look like old-style "helmet hair." If you create separate textures for each of your color variations, they can have all of the subtle shading and highlighting built into them. In the end, you'll be able to wear red hair that doesn't look like someone painted blonde hair red.

Thanks so much for the speedy reply, and while I did sorta understand all of that I don't even know where to start with getting that script made up, I'm still pretty .. basic to scripting *earflats* 

 

The hair I have is moddable thankfully, I currently have a script made by a friend LONG ago that lets me set every prim to either one color or rainbow ((no idea how he did that but it's pretty)) While I love it to do death I do want one that lets me have slightly more control if possible. My ability to affect textures however is about as bad as my ability to ...well I suck at it lol 

 

In the end what I'm looking for is probably going to be insane so I'll end up having to probably color it manually as much as that thought makes my eyes bleed in anticipation of spending an entire day finding each prim *snicker* regardless thank you SO much :)

Share this post


Link to post
Share on other sites
  • 0

If you just want to color the entire hair, there's no need to pick out each individual prim.  Get a hair texture.  This will probably not be one solid color, but will be a color with "hair strands" drawn in it.  Make a safety copy of the hair.  Drag the working copy out of your inventory and set it on the ground.  Right click it and select Edit.  Go to the Texture tab.  Drop your hair texture into the lower texture box in that window.  ALL the prims will take on that texture.  You may need to use the rotate and sizing buttons to get the strands going the right way.  And you might need to do that to some individual prims.

If you have hair that is already textured, but a white color, it's even easier.  Click the upper "color" box in the texture tab of the Edit window.  Use the color picker that appears to tint the entire hair at one go.

No scripting required!

Edited by Lindal Kidd

Share this post


Link to post
Share on other sites
  • 0

ya I know that I can edit it like that, just realllly didn't wanna do that for the 300 some prims that i have to work on since as I said I'm trying to go two tone with it lawl :P Regardless all the input has helped, think I'm just gonna make it all the one color, then slowly edit the second color in sporadically just to see if I can make it work lol ..... thanks again !!!!! :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...