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 & Fashion.
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 & Fashion.
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. 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! :)
82028-071006-737419-52
© 2007 All Rights Reserved.


27 comments:
This is fun and great info! keep up the great work! Thank you!
Polly :)
Thanks for the tutorial! This sheds a little light into this complicated matter.
Polly, thanks. Hope you have fun making the hair :)
Lauralee, its messy, isnt it? I hope to start tweaking it in future tutorials... :)
AWESOME AWESOME AWESOME!
At long last, a decent tutorial on this subject. Can't wait for further installments!
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 :)
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:
http://youtube.com/watch?v=4eTa6U7pP6w
Cute. :)
Torley, thanks for the link! Thats such a cute video :) It *almost* looks like Nakama in SL :P
i dont get the "hair lock " part .. whats teh hair locksname?
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...:)
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!
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!
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
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...
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.
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!
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
Dear Anonymous, hmm...it 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...
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.
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 :)
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? :(
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!
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
Okay never mind i got the options to show forgot to mak it a torus...but now i have another problem..no 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.?
Khad, lol what's the message?
it always says ERROR : Syntax Error and at different times it'll say 2 numbers in parenthesis...=/
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 :)
Post a Comment