Friday, February 02, 2007

Day 131: Creating Prim Hair Part 2

This is the second of a 2-part tutorial on building a set of static prim hair.

In Creating Prim Hair Part 1, we created an Bald Hair Base and a Hair Texture for the tutorial.

You will need Ged Larsen's wonderful LoopRez Script to complete this part of the tutorial. If you dont have the LoopRez Script, you can pick up a free copy in the Freebie section of Sirena Hair.

If you want to skip Part 1 of this tutorial, you can also pick up a ready-to-use Prim Hair Texture from Sirena Hair.

The LoopRez Script takes a sample object, then replicates it in a circle. There are a number of settings you can make to adjust the number of objects, size of the circle, and the rotation. I wrote a previous blog entry about the LoopRez Script for creating Flexi-Prim Skirts. We will use the LoopRez Script to create the starting point for our prim hair.

Here's a quick overview of what we will be doing: First, rez the LoopRez object on the ground. Put a lock of hair into the Contents tab of the LoopRez object. Edit the LoopRez script with the appropriate settings. Touch the LoopRez object to generate the prim hair. Link the prim hair. Wear and fit the prim hair on your avatar. Adjust the styling of the prim hair.

Go to a place where you can create objects, such as a Sandbox.

1. Rezzing the LoopRez Object

The LoopRez Generator folder has a "LoopRez v0.6 object, full perms" object. If you are making prim hair for yourself, or just testing, just use this LoopRez object. If you want your name as the Creator of the finished prim hair (if you want to sell the hair), follow Step 1 in the Flexi Prim Skirts tutorial to create your own LoopRez object.

Drag and drop the "LoopRez v0.6 object, full perms" to the ground.

2. Create and Put a Lock of Hair into the LoopRez Object

We will create a lock of hair that will be replicated by the LoopRez Object.

Rez a new Torus on the ground. Go to the General tab. Change the name to "Hair Lock".

Go to the Object tab. Enter the following settings:

     Size (meters) X: 0.450
     Size (meters) Y: 0.250
     Size (meters) Z: 0.200

     Path Cut B: 0.350
     Path Cut E: 1.000

     Hole Size X: 0.30
     Hole Size Y: 0.35

     Taper X: 1.00
     Taper Y: 1.00

Go to the Texture tab. Click on the square above "Texture" to open the Pick: Texture window. Either select the Hair Texture you created in Part 1 of this tutorial, or the "Tutorial Hair Texture" from the Prim Hair Texture folder.

Enter the following settings:

     Repeats Per Face Horizontal (U): 1.000
     Repeats Per Face Vertical (V): 2.000

     Offset Horizontal (U): 0.000
     Offset Vertical (V): 0.500

Right-click on the Hair Lock object you just created and select "Take".

Now, Right-click on the LoopRez object on the ground. Select the Contents tab. Drag and drop the Hair Lock object from your Inventory to the Contents tab of the LoopRez object.

3. Edit the LoopRez Script

OK, now we need to tell LoopRez how to build the hair.

Edit the LoopRez object and go to the Contents tab. Double-click on the "LoopRez v0.6" script to edit it. Enter these settings:

     string objectName = "Hair Lock";
     integer numObjects = 36;
     float xRadius = .054;
     float yRadius = .041;
     float flareAngle = 15.0;
     float bendCoefficient = 0.0;
     vector rotOffset = <0.0, 270.0, 90.0>;
     vector posOffset = <0.0, 0.0, 1.0>;

To save your changes, click on the "Save" button at the bottom of the window. Wait for the message "Save complete." to show up in the message area before closing the window.

4. Generate the Prim Hair

Close the Edit window. Stand back, and Touch the LoopRez object (just click on it).

If all goes well, there should be a head of hair above the LoopRez object! :)

If nothing happens, it may be one of 2 things:

First, you may be in an area that does not allow foreign scripts to run. There is typically an indicator icon at the top of your screen that shows this. Try moving to a public Sandbox just to see if your LoopRez object is working.

Second, the script may be disabled in the object. You can check by Editing the LoopRez object, going to the Content tab, and Double-clicking on the "LoopRez v0.6" script. This will open up the script editing window. At the lower left side of the window, there is a checkbox next to the word "Running". This checkbox needs to be checked. If it is not, then check it, exit Edit mode, and try again.

5. Linking the Prim Hair

The newly created prim hair are made up of separate locks of hair. We need to link them together to make a single prim hair object. In addition, we want to add an object in the middle so it would be easier to position and fit the prim hair on our head. We will use a copy of the LoopRez object in the middle of the prim hair.

First, we are going to make a copy of the LoopRez object. Right-click on the LoopRez object, and select Edit. Now press and hold the Shift key. Click and hold on the Blue arrow and pull it up above the prim hair.

This will create a copy of the LoopRez object. Put this copy above the prim hair for now.

Go to the Content tab of the copy of the LoopRez object, and delete everything (Right-click on each file and select "Delete"). This will prevent accidentally setting off the script again. :)

Next, go to the Object tab and make the Size smaller. I typically use X=0.050, Y=0.050, Z=0.050.

Now while you are still in Edit mode, draw a box around all the locks of hair and the copy of the LoopRez object. Dont include the original LoopRez object. You may find it helpful to go to the Tools menu at the top of your screen and select "Select Only My Objects".

Then press and hold the Shift key. Click on the copy of the LoopRez object to deselect it. Click on it again to select it. This will make the copy of the LoopRez object the Root Prim.

Click on the Tools menu at the top of your screen and select "Link".

Now click on "Edit linked parts" at the top of the Edit window. Select just the copy of the LoopRez object (only the LoopRez object should be highlighted). Move the copy of the LoopRez object below the prim hair. This will hide the copy of the LoopRez object from view once it is fitted on your head.

Select the General tab in the Edit window. Change the Name to "Tutorial Prim Hair".

Now close the Edit window to get out of Edit mode. Right-click on the prim hair and select "Take".

6. Fitting the Prim Hair

At last, we have something to Wear! :)

First we need to put the bald base on. Find the "Bald Hair Base" in your Inventory (or any prim hair bald base). Right-click on it and select Wear.

Next, find the "Tutorial Prim Hair" object in your Inventory (probably under the "Object" folder). Right-click on it, select "Attach To >", and click in "Skull".

When you first attach the prim hair, it will be oriented incorrectly (Dont laugh, its not funny :P). Right-click on the prim hair, and select Edit. In the Object tab, enter the following values:

     Rotation (degrees) X = 270.00
     Rotation (degrees) Y = 0.00
     Rotation (degrees) Z = 90.00

Now slide the prim hair into place using the 3 Red/Green/Blue arrows. As a reference, look at the numbers at the top of your screen. It fits me well at these settings: "X:0.000 Y:-0.010 Z:-0.021".

7. Adjust the Prim Hair Styling

OK, you now have a head of hair, but it looks like you havent had a hair cut in a couple years. So we are going to do a bit of styling to this hair.

Although its optional, you may find it helpful to stand on a pose-stand while doing these steps.

Right-click on the prim hair and select Edit. Click on "Edit linked parts" at the top of the Edit window.

Find the lock of hair thats direcly above your nose. Select just this lock of hair. Lets call this the Center Lock. Change the settings on the Center Lock as follows:

     Size (meters) X: 0.450
     Size (meters) Y: 0.150
     Size (meters) Z: 0.100

Use the Blue and Green arrows to reposition the Center Lock until it just sticks out of the top front of your head. Note: you should move the lock out of the skull as soon as you can. Otherwise, you would have to detach the hair and rez it on the ground in order to retrieve the lost lock of hair!

Then press and hold the Ctrl key and use the Red wheel to rotate the hair until the bottom stops poking into your skull :P

Now select the lock to the left of the Center Lock and apply the following settings:

     Size (meters) X: 0.450
     Size (meters) Y: 0.150
     Size (meters) Z: 0.100

(Stop laughing... its still not funny :P)

Use the Blue and Green arrows and reposition the left of Center Lock until it just sticks out of the top front of your head and slightly below the Center Lock.

Now select the lock to the right of the Center Lock and do the same things as the one on the left above.

Repeat this, until 7 locks of hair up front have been adjusted, 3 to the left of the Center Lock, and 3 to the right of the Center Lock.

Remember, this is hair styling. Its an art. So theres no right or wrong way of doing it. Just do it until you think it looks right :)

OK, at least I can see now. :)

Next, we want to add a slope to the rest of the hair going to the back of our head.

Find the Center Lock at the back of our head. This will be at the back of our head, directly across from the Center Lock. Lets call this the Back Center Lock (as Rachel mentioned in the comments, it is the one at X:0.00). If you arent sure exactly which one is the Back Center Lock, just pick one. Again, its just hair :)

Change the settings on the Back Center Lock as follows:

     Size (meters) X: 0.450
     Size (meters) Y: 0.400
     Size (meters) Z: 0.200

Use the Blue arrow only and reposition the Back Center Lock until it fits in with the rest of the hair.

Now lets work on the left side from the back to the front. Select the lock to the left of the Back Center Lock. Change the settings as follows:

     Size (meters) X: 0.450
     Size (meters) Y: 0.390
     Size (meters) Z: 0.200

Use the Blue arrow only and reposition the Back Center Lock until it fits in with the rest of the hair.

Select the next lock of hair to the left. Change the values to the same as the above, except decrease the Size (meters) Y by 0.010. In this case, Y should be 0.380.

Keep adjusting the hair on the left until you have reached the front. For each lock of hair, decrease the Size (meters) Y by 0.010.

Now do the same thing to the right side. Starting with X = 0.390 for the lock of hair to the right of the Back Center Lock.

Congratulations! You have just completed your first prim hair! :)

As you have noticed, the styling work you do at the last step really affects how the hair looks. So go ahead and make a copy of the "Tutorial Prim Hair", Wear it, and play around with different settings.

Try adjusting the Size, Skew, and Hole Size. To add some curls, adjust the Revolutions.

Just be sure that you keep a copy of the original hair before you start tweaking it. We will be using the original as a base in future tutorials :)

In Part 3 of this tutorial series, we will be adding curls, bangs, and styling to this prim hair.

Have fun with your new prim hair! :)

numly esn 82028-071006-737419-52

© 2007 All Rights Reserved.


Anonymous said...

This is fun and great info! keep up the great work! Thank you!
Polly :)

Lauralee said...

Thanks for the tutorial! This sheds a little light into this complicated matter.

SLNatalia said...

Polly, thanks. Hope you have fun making the hair :)

Lauralee, its messy, isnt it? I hope to start tweaking it in future tutorials... :)

Pyxel Courier said...


Decibel said...

At long last, a decent tutorial on this subject. Can't wait for further installments!

SLNatalia said...

Pyxel, thanks :)

Decibel, it really is much harder writing a tutorial for this than doing it. There are so many things one could do, but is hard to explain! Anyway, hope this helps :)

Torley said...

Super hair tutorial, Natalia. Looks like it took some time for you to lay this out, but I'm glad you did. Having the hair cover your eyes reminds me of the characters in Jean Michel Jarre's Teo & Tea video:

Cute. :)

SLNatalia said...

Torley, thanks for the link! Thats such a cute video :) It *almost* looks like Nakama in SL :P

Anonymous said...

i dont get the "hair lock " part .. whats teh hair locksname?

SLNatalia said...

Dear Anonymous, the "lock" of hair is the single prim of hair we made. I just called it "lock", cause its a bunch of hair...:)

Sai said...

Okay, I got mostly through this tutorial, and ran across a problem: I can't seem to find the "Select Links Parts" in the edit section. There is a "Edit Linked Parts", but that doesn't seem to be the correct one. Am I just missing something... *Feels stupid*

Anyways, I absolutely love your site, especially these tutorials. You've shown me some really neat and beautiful places to visit!

SLNatalia said...

Sai, thanks for catching that! Yes, its suppose to be "Edit linked parts"...(I get confused easily :P)

Basically in that step, you need to select just the copy of the LoopRez object. Because the LoopRez object has been linked to the rest of the hair, you need to select "Edit linked parts" first before SL will let you select just the LoopRez object. Sorry about that!

Anonymous said...

Great tutorials, great blog, congratulations for your miss second life prize ;)

The thing is that when i've changed the scipt, saved it (already put the lock in the contetns, with the same name in the script...etc) and i touck the object in the ground, it doesn't become a hair, it just keeps the same shape.

I'm in a public sandbox and run is enabled.

Thank you

SLNatalia said...

Dear Anonymous, the only thing I can think of is that the first line of the script should be: string objectName = "Hair Lock";

This tells LoopRez to use the "Hair Lock" object instead of one of the sample skirt panels.

Hope this helps...

Kimberly said...

Thanks for the tutorial. I'm having a problem. I can't drag and drop my lock into the contents tab of the loopres object. I'm the owner but I'm not the creator of the loopres. Is that a problem? When I drag it i get the little circle with a line going through it...aka....ghost buster sign.

SLNatalia said...

Kimberly, you just have to be the Owner (not the Creator) of the LoopRez object to put something into the Contents tab. If you rezzed a box on the ground, can you put the lock into its Contents tab? (Sometimes SL acts up a bit, so you might want to try it again at a diff place or diff time...) Hope this helps!

Anonymous said...

Uhm, when i go to edit the rezloop to create my hair and i put in the script with the "hair lock" thing, it keeps saying (7,34) : Error : Syntax error

SLNatalia said...

Dear Anonymous, sounds like you changed the whole top part of the LoopRez script, so its hard to tell which line is which...

It might be as simple as a semi-colon at the end of the line (dont forget it!)

Otherwise, try using a clean version of the LoopRez script. Make a small change, then save it periodically. That would show you what the problem is...

Funn Lim said...

Thank you very much for this very easy to follow instructions. I have successfully reached the stage before styling and the styling of the bangs was indeed very very difficult. Sometimes I feel very difficult looking at what I am doing because there were simply too much grid/colour grid for the directions, the lock of hair, all at the same time. However your tutorial has been a blessing; I seriously believe I can make my own hair.

I have a question though. Is the hair lock that is generated as the tutorial prim hair the base of any hair designs? I wanted to make a straight bangs with straight medium shoulder length hair, I tinkled a bit with the hair lock, thought I got a desired look but when I used the Looprez, one end didn't meet the other, unlike the one in the tutorial. So I was wondering using the specifications of your sample hairlock, is it possible to make any hairstyle, depending on the curlings, and such?

For your info, I would like to make those really straight hair with bangs, like those egyptian wigs.

Please advise.

Natalia Zelmanov said...

Funn, lol you are not going to like this answer: I believe that a tutorial should give you a definite result at the end (hopefully something that you can actually use). So in order to write a hair tutorial, I had to use LoopRez to create a bunch of hair locks/prims. Hopfully the tutorial gave you a good idea of how to go about arranging and styling prims to create a prim hair.

But in practice, you would probably need to create a base from scratch if you are making a complex hair. Its not that hard (but does take a bit of patience). Try using the hair from the tutorial and modify/rearrange it to what you need. You might find that easier to do at first :)

Anonymous said...

This is a great tutorial thanks.

but I have one question. everytime I use the loop rez all I get is a big ring of locks instead of a head of hair! what am I doing wrong? :(

Natalia Zelmanov said...

Dear Anonymous, it could be the settings in the LoopRez script. Be sure these are exactly the same:

float xRadius = .054;
float yRadius = .041;

Good luck!

Anonymous said...

This is SOOOO awesome..only, I have a problem. Whenever I drag out my object and right click, edit, and object to change the size, etc..all of the options on the left are greyed out (path shape, taper, etc.)..What gives? I would LOVE to make some hair but cannot get past even this! I'm sorta new..sorry if Im asking a dumb quesiton, hehe. -- Khad

Anonymous said...

Okay never mind i got the options to show forgot to mak it a torus...but now i have another matter what i do, no matter how many times i start over, i cant seem to get that error message to go away when I go to edit and enter the info...grrrrr! What now? ill just enter the first sentence, and it'll give me an error when i try to periodically save.?

Natalia Zelmanov said...

Khad, lol what's the message?

Anonymous said...

it always says ERROR : Syntax Error and at different times it'll say 2 numbers in parenthesis...=/

Natalia Zelmanov said...

Dear Anonymous, try changing 1 line at a time and press "Save". The script thing is really touchy (you cant even miss 1 semi-colon). Lol but trust me, the script works :)

Rainey Paderborn said...

tyssm for the tutorial Natalia :) when I apply the hair texture it comes out horizontaly oriented instead of vertically :( I'm able to use the texture so i think I must be doing something in creating the hair lock :( I's be so grateful for any help or advice please

Natalia Zelmanov said...

Rainey, you can rotate the texture in the Texture tab until its the right way :)

Rainey Paderborn said...

Tysssssm Natalia <3

It worked like a charm! You rawk :D <3

When I'm finished with the Do i'm working on, I'll send you a piccie XD


Natalia Zelmanov said...

Rainey, Im glad it worked! Heehee have fun! ;)

Anonymous said...

Hey Natalia! I've learned to make clothes using your awesome tutorials and now i have my own store! I want to move on to hair, but i have a question. if i'm using the commercial edition of the looprez, how do i set the float settings and the bend coeffecient thingy? Thank you for all of your help. you are the best! Oh, and i love your new scripted hairs!

Deea Rayna

Natalia Zelmanov said...

Deea, I dont actually use LoopRez to make hair (I did it in the demo just to create a base, because it would take forever to spell out a bunch of prims otherwise). But the product hairs are individually placed by hand...

Lu said...

Thanks for the Tutorial, its really helpful.. But I just noticed, every time I make the hair lock, the texture goes horizontal instead of diagnol...What am I doing wrong?

Natalia Zelmanov said...

Lu, just rotate the texture by 90 degrees (Under the Texture tab)

Anonymous said...

Great tutorial!

Natalia Zelmanov said...

Dear Anonymous, thanks ;)

Lina said...

This seems like a great tutorial and I want to try it out, but it tell me that Sirena Hair & Fashion is an invalid location.

Natalia Zelmanov said...

Lina, try Search/Places for "sirena". Lol I have no idea how the big search works :P

Cyne Christenson said...

The questions here are as informative as the tutorial itself! I was trying to create a custom hair that is rather complex and was getting thwarted by the loop-rez. Good to know my inclination to just do it all by hand (and save my PC from taking a trip out the window) is the correct one.
I do have one question in regards to this. Do you have a 'dumy head' you use as a base or do you use your avi as a living model? As I am inclined to try...
Thank you for everything!

Natalia Zelmanov said...

Cyne, lol Im the dummy in this case (I dont use a dummy head).

Anise Shaw said...

I just finished making my first prim hair in Open sim with your tutorial! It was fantastic fun, and your directions are very easy to follow.

I'm also thinking about playing around with some of the LoopRez settings to see what else I can get out of it!

Natalia Zelmanov said...

Anise, congratulations! Heehee isnt it fun?

I dont know anything about Opensim, but Im very glad to know Looprez works in it :) Actually, it's cool that you can use the same scripts!

Rachel said...

Thank you! This has really helped me :) Can I just say that something people might find useful when finding the back hair prim centre, it will be at position x:-0.00 :) That may help some people :D

Natalia Zelmanov said...

Rachel, thank you for the clarification! I added it to the tutorial :) Lol it could be a challenge finding that prim!

Rachel said...

Hi, Rachel again! lol, jus thought id say u put it in as x=*+*0.00 in stead of x=*-*0.00, Sorry I should have made it clearer lol :) x

Natalia Zelmanov said...

Rachel, Im not totally sure about this, but I think +0.00 and -0.00 are the same (or really, really close).

lol I should check it with the Emerald viewer. Im guessing that -0.00 is when the position is slightly negative, like -0.0001. The Emerald viewer lets you see the extra digits.

Anonymous said...

I keep getting a syntax error whenever i edit the looprez script :/

Anonymous said...

Hmm.. I must not have done something correctly as my hair locks are in a huge circle above the looprez object. :/

Anonymous said...

can someone tell me wich scrip to change is so looprezz personal edition know i want to make hair and not a skirt? whatever i do i cant change any scrips.... what i do wrong? we have 2012 may he have change it?

Elisabel said...

Hello! i want to make some flexi hair, mesh hair.. i don't know anything about make stuf in SL.. is this tutorial old or you could recomend some other that will be new to wear cool hair? i want my hair to move!