Saturday, July 07, 2007

Day 286: Creating Flexi Prims Tutorial



Ever since flexible prims were introduced in Second Life just over a year ago (around April, 2006), things have not looked the same. Flexible prims, or flexi prims, enable certain types of prims to bend or flex in reaction to movement or the SL wind. This feature enables designers to create objects with a more realistic feel. Today, many hairs, clothes, plants, decorations, even mermaid tails :) contain a few flexi prims. (And I helped stuff many of them in there ;P)

Theres a great article on Flexible Prims in the SL Knowledgebase entitled The Way of the Flexible Path.

According to the SL History Wiki, flexi prims are a client-side effect. That means flexi prims would not cause lag on the server. So dont feel too bad about using them :) But like anything, if you have too many complex flexi prims, it could slow down the computer of any resident who could "see" your flexi prims.



This tutorial will talk about how flexi prims work and the settings that control them. We are also going to create a set of flexi prim ribbons for wearing around the wrist.


Flexi Prim Overview



So what exactly are flexi prims?














Currently, flexi prims can only be made from Boxes and Cylinders. A flexi prim is a Box or Cylinder with a checkmark in the Flexible Path box. Thats it :)

If you dont believe me, try it:

Go to somewhere that you can build. When in doubt, try a Sandbox.

Click on the "Build" button on the bottom of your screen, then click somewhere on the ground.






You should see a wooden box appear. In the Edit window, if you see the "More >>" button, go ahead and press it to get the rest of the options. Click on the "Features" tab. Then click on the Flexible Path checkbox to check it.

Thats it! You just made a flexi prim :)

OK, you are probably wondering why nothing is happening. Thats because our box is not moving and its not set to be sensitive to the SL wind.

So click and hold on the red arrow and drag the cube back-and-forth. You should see it jiggle like a cube of Jello :)

Before we proceed, lets change our box a little so we can see the effects better.

Right-click on the flexi prim box and select "Edit". Make the following changes:



Go to the "Object" tab and increase the "Size (meters)" setting for "Z" to 3.000.

Change both "Taper" "X" and "Y" to 1.00.














Go to the "Texture" tab. Click on the picture above "Texture". At the the "Pick:Texture" window, click on the "Blank" button and click "Select".

Click on the picture above "Color". At the "Color Picker" window, click on the dark blue rectangle on the bottom and click "Select".

OK, now it should be much easier to see our box flex :)





Flexi Prim Settings

In general, there are a few things you should know about flexi prims:

* Only Boxes and Cylinders can become flexi prims.

* Flexi prims only flex along the Z-direction. The "bottom" of a newly rezzed flexi prim is the "anchor". The "anchor" doesnt flex. The rest of the flexi prim flexes around the "anchor". You can always rotate a flexi prim if you need it to flex in a different direction.

* The longer a flexi prim, the more it will flex. Really short flexi-prims dont flex well (they just kinda jiggle a little).

* Flexi prims are phantom objects (you can walk right through them). Also, anything you link a flexi prim to will also become a phantom object.

* You can torture a flexi prim just like any other prim, except Top Shear doesnt work. So you can use Path Cut, Hollow, Twist, and Taper on a flexi prim.

So what are all those settings under Flexible Path?

Each setting controls an aspect of how the flexi prim behaves when moved. Lets run through them and see what they do.


Softness

Have you ever played with a long candy cane (one still in its wrapper)? If you break it in the middle, you can move the broken end around a little bit. If you break it a couple more times, the candy cane becomes even more flexible.

Think of a flexi prim as a stick with a number of joints in it. The stick can bend a certain amount at each joint. So if the stick has more joints, it can bend more.

The Softness setting determines the number of joints that a flexi prim has. It can be either 0, 1, 2, or 3.



A setting of 0 is a really stiff flexi prim with just 1 joint at the anchor location.



A setting of 3 will flex very well, provided that the flexi prim is long enough.

Note that a high Softness setting creates work for your computer (and anyone who can "see" your flexi prim). If you have more than a couple flexi prims, avoid using a Softness setting of "3". In general, a Softness setting of "2" works well for most things, from flexi skirts to flexi hair.

Try changing the Softness setting and moving your flexi prim around to see the effects.


Gravity

Gravity determines how much downward pull there is on the prim. The setting can be anywhere from -10 to 10.



A Gravity of 10 means a prim thats bends towards the ground. If we rotated our flexi prim sideways, it would point straight to the ground. It will still respond to movement, but will try hard to get back to the ground. Perfect for that heavy flexi skirt you dont want to fly around too much.



On the other hand, a Gravity of -10 gives a strange upward pull to the sky. Sorta weird anti-gravity. Try it on your flexi hair when you first get up in the morning :P


Drag

Drag is kinda tricky. Drag determines whether a flexi prim will snap into place quickly or in slow motion. The setting can range from 0 to 10.

A Drag setting of 0 means there is...well...no drag. So the flexi will whip around freely.

On the other hand, a Drag of 10 makes the flexi action like its in slow motion. Have you seen those flexi skirts that take forever to fall to the ground? They have a high Drag setting...


Wind

Wind is a cool setting :) It determines how much the "wind" in Second Life affects the flexi prim. Yep, theres a wind that constantly blows thru SL. It changes direction all the time. And the strength of the wind varies as well. And oh BTW, the SL wind goes right thru walls (so its blowing indoors as well :P).

The Wind setting gives your flexi prim a natural movement. This is great for hair. It's especially important for stationary flexi prims, like flags or ribbons; otherwise, stationary flexi prims wont move at all.

The Wind setting can range from 0 to 10.

A setting of 0 means the SL wind has no effects on the flexi prim.

A setting of 10 means the flexi prim will flap wildly to the slightest SL wind. It will also be very sensitive to direction changes in the SL wind. Great for things like ribbons :)


Tension

Tension determines how stiff the flexi prim is. It sorta gives the flexi prim a backbone. The Tension setting can range from 0 to 10.



A setting of 0 means there is no tension. The flexi prim will be like a piece of string with very little stiffness. This is what ribbons should be set to.



A setting of 10 means a very stiff flexi prim. It will act almost like a spring, and will try to maintain its shape.





X, Y, and Z

The X, Y, and Z settings gives a push in the respective direction. The settings can be -10 to 10, so it could be a positive or negative push (or pull, so to speak).

Note that these settings are always relative to the sim. So they have very weird effects when used on attachments. Um...picture a piece of hair that always wants to point towards the west :P For the most part, these settings are not very useful for attachments. The Z setting is almost identical to Gravity (so you might as well use Gravity).

For stationary flexi prims (like flexi prims on buildings), these might be useful in creating an effect. For example, you can use the X setting to make a flag point towards the east, unless theres a very strong wind in another direction.


Making Ribbons



Now that you know how flexi prims work, lets make one of my favorite attachments: flexi ribbons :) We are going to make a simple ribbon for wearing around the wrist. Because ribbons are suppose to be flexible, they are a great way to get started with flexi prims.



Click on the "Build" button at the bottom of your screen, then click on the ground. You should see a Box appear.



Go to the Object tab. Change the "Building Block Type" from "Box" to "Torus".



Change the following settings:

   Size X: 0.050
   Size Y: 0.100
   Size Z: 0.100

   Rotation Y: 90.00

   Hole Size X: 0.50
   Hole Size Y: 0.10



Go to the "Texture" tab. Click on the picture above "Texture". At the the "Pick:Texture" window, click on the "Blank" button and click "Select".

Click on the picture above "Color". At the "Color Picker" window, pick a light/pastel yellow color (or any color you like). Click "Select".



Next we want to make a copy of the Torus and turn it into a ribbon.

Press and hold the [Shift] key. Click on the Red arrow and drag the arrow to the right. This will create a copy of the Torus.



Go to the Object tab. Change the "Building Block Type" from "Torus" to "Cylinder".

Change the following settings:

   Size X: 0.050
   Size Y: 0.100
   Size Z: 0.600

   Rotation X: 0.00
   Rotation Y: 270.00
   Rotation Z: 180.00

   Path Cut B: 0.480
   Path Cut E: 0.520

   Hollow: 95.0

   Taper X: 0.00
   Taper Y: 0.00



Here comes the fun part :)

Go to the Features tab. Click on the "Flexible Path" checkbox to turn the ribbon into a flexi prim.

Change the following settings:

   Softness: 3.000
   Gravity: 0.500
   Drag: 5.000
   Wind: 1.000
   Tension: 0.000



Use the Red arrow to slide the ribbon into position behind the Torus. Use the Blue arrow to move the ribbon up and down as necessary.

Notice that a flexi prim moves differently than a regular prim. When you move a regular prim, you are moving the prim relative to its center. When you move a flexi prim, you are moving the prim relative to the anchor side (the side that doesnt flex). This also works the same way for rotation.



This is an optional step (but kinda important). Ribbons tend to look better in a group. So we are going to make a couple copies.

Press and hold the [Shift] key. Click on the Green arrow and drag the arrow to create a copy of the Ribbon.

Now go to the Texture tab and pick a different light/pastel color for the new Ribbon.

For better effect, try going to the "Features" tab and varying the settings for the new Ribbon. This would make each Ribbon respond differently to movement and the SL wind. For example, try these settings on the new Ribbon:

   Softness: 3.000
   Gravity: 0.100
   Drag: 3.000
   Wind: 2.000
   Tension: 0.000



Once you are done making additional Ribbons, its time to link them together so we can wear it! :)

Right-click on one of the Ribbons and select "Edit".

Press and hold the [Shift] key and click on all of the other Ribbons.

Finally, click on the Torus. Make sure that you click on the Torus last (this will be our Root Prim).



Click on the "Tools" option from the top menu bar and select "Link".

All of the Ribbons should be outlined in blue. The Torus should be outlined in yellow (which indicates it is the Root Prim).












One last thing: We want to change the Name.

Right-click on the Torus and select "Edit".

Go to the "General" tab and change the Name to "Ribbons-Left".

Finally, Right-click on the Torus and select "Take" to take it into our Inventory.


Fitting the Ribbons

Its time to try on our new Ribbons...

Find the "Ribbons-Left" object in your Inventory. It should be in the Objects folder.

Right-click on "Ribbons-Left" and select "Attach To >" and "L Forearm".



When you first attach most objects, they usually show up in a funny spot. In this case, they are embedded in my arm :P



Right-click on the Ribbons-Left object and select "Edit".

Go to the Object tab and enter the following changes:

   Rotation Y: 90.00
   Rotation Z: 270.00



Use the Green arrow to slide the Ribbons-Left down to the wrist. If you use the numbers in the center of the screen as a guide, the Ribbons-Left should be at about X:0.000 Y:0.109 Z:0.000.

Right-click on the Ribbons-Left and select "Detach". This will detach the ribbons and "save" the changes we made. From now on, you can simply "Wear" the "Ribbons-Left" object.

Thats it! You have created your very own flexi ribbons.

Try playing with the various settings to see how they affect the ribbons. This is a great way to understand how flexi prims work...

Once you feel comfrotable with flexi prims, try these tutorials: Flexi Prim Skirt and Flexi Prim Hair Part 4.

Have fun making things move in Second Life :)




numly esn 58949-071006-506630-29

© 2007 All Rights Reserved.

26 comments:

Anonymous said...

Another great tutorial, thank you so much!!!
Elena

Anonymous said...

Just wanted to say: Thank you! Thank you! Thank you!!!!
You're wonderful!
Myllie Writer

Anonymous said...

Excellent information.

Are you sure you aren't a Linden pretending to be a blonde?

SnakeArsenic said...

Natalia this takes the guesswork out of flexi-prims, well done!

SLNatalia said...

Elena, you are welcome! I hope you find it helpful :)

Myllie, heehee thanks. I wasnt sure if this would be a helpful tutorial, so Im glad you like it!

Dear Anonymous, heehee Im more like a blonde pretending to be a Linden :) Im not sure Linden Labs would hire a blonde fish...they would end up with a lot more water in SL ;P

Snakearsenic, I hope this is helpful! This was something that I wish I had when I started working with flexis...

Slartibartfast Hammerer said...

Thanks for this tutorial Natalia, great to have an in depth explantion of each of the various settings. One for my permanent bookmarks :)

SLNatalia said...

Slartibartfast, heehee thanks...I was hoping they would be useful!

confused said...

Thanks so much Natalia, very good tutotial. Cannot wait to try it out.

SLNatalia said...

Confused, have fun with it! Its pretty and can be used with a lot of things :)

Anonymous said...

Extremely confused. Either i'm doing something horribly wrong or the number I am supposed to plug in just give me a standing cylinder instead of a belt look

SLNatalia said...

Dear Anonymous, not sure which piece you are referring to...if its the part that goes around the wrist, be sure to change it to a Torus. If its the ribbons, be sure to set the Path Cut and Hollow parameters :)

admin said...

If its the ribbons, be sure to set the Path Cut and Hollow parameters

What effect do the Path Cut and Hollow have on the ribbons?
Would they flex differently, or change the appearance?

SLNatalia said...

Admin, the Path Cut and Hollow changes the appearance of the flexi prim. A normal prim (cylinder) has a minimum size of 0.01M. By making it hollow and cutting part of it out, we make it look more like a thin, flat sheet (just like a ribbon :D).

Anonymous said...

Omg!!! Tanks to dis I can FINALLY get rid of mi flexi prim scare haha iloveyu 4 dis!!

Natalia Zelmanov said...

Dear Anonymous, lol Im glad to help. Good luck with flexis ;)

Anonymous said...

Not many people are willing to share their knowledge with everyone but you've shared so much with us. Thank you so much =)Your tutorials have helped me a lot.

-Amy.

Natalia Zelmanov said...

Amy, heehee thank you! Good luck on your projects ;)

Eugene said...

Hi Natalia. I created a bustier for my gf, and attached to each pect (breast) two fringes, non scripted, made with two cutted & hollowed cylinders (actually it is just one, copied / pasted in the inventory, and attached to the left and right breast; a hard task to have them specular... didn't they ever thought to put mirroring amongst the edit commands?), which was treated as flexibles. But sometimes, when she assumes a pose, it happens that the attachments move from their assigned place (either they rotate around the avie's imaginary axis, or displace in other ways): can you tell me what happens please?
TY.

Eugene said...

well, thank you anyway.....
perhaps you don't visit this post anymore.

Natalia Zelmanov said...

Eugene, you might want to experiment with different Attachment Points and see if that makes a difference (try L/R Shoulder or L/R Peck)

Eugene said...

Hi Natalie, indeed the attacments are actually attached to the right/left pect (that is, each breast).

Natalia Zelmanov said...

Eugene, I think the only thing you can do is work around it. Try moving the attachment around, etc. Unfortunately, it is fairly common for attachments to end up looking weird under certain poses :P

Eugene said...

oh well, ty anyway, i've guessd that there was to do nothingelse but fiddling with it :-)

Natalia Zelmanov said...

Eugene, good luck ;)

Anonymous said...

Hi there, do you have any idea on flexi and jewelry? It would be great to see a tutorial on that, as once you do all the cuts etc, it doesnt seem to go flexi very easily. Cheers and well done for the great work.

Natalia Zelmanov said...

Dear Anonymous, actually, you can use Path Cut on a flexi prim (it doesnt affect the flex). But flexi prims dont work well when they are very short - they simply dont flex. Unfortunately, thats an SL limitation :(