Monday, March 22, 2010

Want a Frame on That Prim? Here's How.

Have you been wondering how to frame your pictures in SL?  Here's a simple frame script you can use to make a frame out of a prim.  You can use any texture for the frame edges, and stick your picture on the front.  I'll go through it step by step.  First, here's the script:

default

{
state_entry()
{
llSetPrimitiveParams([PRIM_SIZE, <2.0
,3.0,.1>]);
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, 0, <0.0,1.0,0.0>, 0.0, <0.0,0.0,0.0>, <0.9,0.9,0.0>, <0.0,0.0,0.0>]);
//llSetPrimitiveParams([PRIM_ROTATION, <90, 0, 0, 1>]);
//llSetColor(<0,0,0>, ALL_SIDES);
//llSetColor(<1,1,1>, 0);
}
}

That script will turn any prim into a 2 meter by 3 meter prim with a beveled edge if you drag or drop it into any blank prim.

Here's how to use it:

Create a prim, right click on it, and pick edit
Notice the two blue buttons just above the middle of the edit box?  The one on the left says New Script.  Click on it to make a new script.  You'll see a message that says "Hello Avatar" on your screen, and a script will appear in the edit box.


Use your mouse to cover the default script and paste in the one I provided above instead.  You'll be replacing the script that says "Hello Avatar" with the script that makes your prim into a frame.  Your prim should now look like a 2m x 3m prim with beveled edges.  Inside will be a script, which you should rename.  Right click on the script and choose Rename, then type in the name you want--I called mine Frame Script.  You won't want to leave your script in the prim after it has done its work, so drag it into your inventory to save it, and then delete it from the prim.

Now you are ready to texture your frame and add a picture to the front.  Choose a texture from your inventory.  If you don't have any textures you've picked up from a freebie store or purchased, you have some in your Library (the stuff we all come into Second Life having in our inventories.)  I'm using the Brazilian Rosewood texture from the Library here.

Click on the Texture tab on your prim's Edit box and drag the texture from your inventory to the box on the left (it says texture under it.)


Now you have a wood texture on all of the sides of the prim.  You could use any texture.  I like to use a shiny metal texture that is freely available in SL.  The next step is to get the picture from your inventory and put it on the front of the prim.  Search for the picture you want in your inventory, and once you find it, drag it onto the surface of the frame prim.

As you can see, my picture is sideways, but I can easily turn the prim.  If I want the frame to be a different size, I can do that, too.  To resize, click on the Object tab on your prim's edit box.

You can change the size of your prim by changing the numbers in the size section in the Object tab.  Alternately, if you hold down Ctrl and Shift, you can use your mouse to drag the prim out to the size you want.  While you are in the Object Tab, you can also straighten your prim out, so it will hang on the wall straight.  In the area labeled Rotation, make sure all of the numbers are a multiple of 90 (0, 90, 180, 270, or 360.)  I made my prim 3m x 3m and straightened it up, here.

As a finishing touch, you can go back to the texture tab, and turn on Full Bright.  You will probably also want to give your prim a name, so that it won't be in your inventory as "Object"--which will make it pretty hard to find :)

I called mine My Picture Frame--now you can set the permissions on your picture--in case you want to give it to someone.

Notice that on the bottom of the Edit Box, there are 3 checkboxes.  It says Nex owner can: Modify, Copy, Resell/GiveAway.  If you want to give your picture to someone, and also want them to be able to use it to make their own picture fram, you will want to set it to allow Copy and Modify.  If you want them to be able to share it with friends, you will want to set it to be transferrable (Resell/GiveAway).  If you don't want it to be given or changed, you can click only on Copy, leaving Modify and Resell/Give Away blank.

Remember that script you dragged into your inventory at the start?  You can use it from now on to make frames out of any prim you make or have modify rights for.  Just drag it into the contents of the prim (or even onto the prim itself.) Be sure to remove it every time you use it, so that you don't have unnecessary scripts left hanging out to cause lag. That's it--I hope you found this useful.

Keywords: How To Make A Frame, Second Life, Frame Prim, How To Texture Prim, How To Bevel Edges