Saturday, April 25, 2009

Single-prim vendor selling in SL

Many people in Second Life sell their products in scripted vendors. Many more seem not to know how to sell their products at all.

However, Second Life includes a very simple, straightforward way to sell products, with no scripts at all - extremely low lag and reliable. It's built in to the prim editing system.

Preparing the items



To start with, you need something to sell. Making that something is beyond the scope of this tutorial - but I have other tutorials for some of that, and you can always check out NCI and other tutorial places inworld.

Once you have your product exactly as you want it, you should make sure its permissions are set for sale.

If your item is prim-based, set its permissions in the General tab, while it is rezzed inworld. That is more reliable for prim objects than setting permissions in the inventory.

For items that aren't prims, right click on the item in inventory, and select Properties. Set its permissions in the Properties window that appears.

In all cases, we are setting 'Next Owner' permissions - the permissions that the person we give or sell the item to will have. Those permissions can never be greater than the permissions we ourselves have.

When we create an item, we have full permissions on that item. If we give or sell someone else the item with a limited permissions set, then they give it back to us, we only have those limited permissions. Or even less, if they changed the 'next owner' permissions while they had it.

Permissions are Copy, Modify and Resell/Give Away. We usually call the third one Transfer.

If you give your customers COPY permissions, they can make copies of the item, they can keep backups in their inventory while a prim item is in world, they can make multiple outfits of clothing items, or make a full set of dining chairs from one sold chair.

If you deny them copy permissions, then if they accidentally break the item somehow (retexture it, distort one of the prims, delete a script), or if Second Life loses the item from its asset server, they have no backup and the item is lost or ruined for good.

TRANSFER (Resell/Give Away) permission allows the player to pass the item to someone else. Denying players TRANSFER permission means they can't use your item as a component of some sale product, and that they can't sell it when they're sick of it.

If you give a player both COPY and TRANSFER permissions, they can give away or sell it an unlimited number of the items. It is often necessary to do this if you're selling components to other builders - such as animations used in furniture, scripts for just about anything, sculpts for furnishings, buildings or jewelry, or textures used in almost anything.

When you give out both COPY and TRANSFER items, include a no-modify notecard explaining whether the person can resell the item as is or not.

When you give out freebies, include a no-modify notecard explaining that the item is to be a freebie, and whether or not you are willing to let other people sell it as is, or modify it and sell it.

MODIFY permission allows a player to tweak and adjust the item to suit them. There is very little reason for blocking modify permission of animations, clothing or skins created with graphics templates, sounds, and sculpties - the hard work in all of those is done outside SL. Even prim items can't be trivially duplicated - it's a lot of work to reverse engineer those.
Scripts, however, can be trivially duplicated by being cut and pasted, so I would recommend blocking modify perms for those, except for freebie or teaching scripts. In those, I suggest including a comment explaining what rights you pass on.

Preparing the image

Open your art package of preference. If you don't have one, The Gimp is free and available at http://www.gimp.org/. Tutorials are available there as well.

Create an image that answers the questions your customers are most likely to have about your product. For most products, provide an image of what it looks like, or what an avatar does when the product is working.

The price is a good thing to include (though some prefer not to, to avoid having to upload another image when the price changes). I personally think that if having the price visible sells one extra copy of the product, the upload is paid for.

Most customers like to see the permissions at a glance, and many customers want to know what they can expect to get in the product package before they buy it.

Make your image the same shape you want it to be in world. If you want a circular sign, make a circle. If you want a square sign, make a square. If you want a 4:3 ratio rectangle, make that.

Once that's done, if there's any transparency in the image, put a background colour you like behind it. (I find that it never helps to have a sign with transparency. If you disagree with me, skip the background.) Now save your sign in the native format of your art program. .psd for Photoshop users, .xcf for Gimp users.

Now resize your sign to powers of 2. Make each side 128, 256, 512 or 1024: ideally 512 or less. This will probably distort your sign - ignore that, it doesn't matter. It'll get fixed when you put it on the prim of the right shape.

If you want to test the image, making sure it looks right before you spend ten Lindens uploading it, use the SL Beta grid, which is a test version of the SL grid. Go to the wiki page talking about connecting to the preview grid. Once there, upload the image as if you were on the main grid, and put it on the same shape prim you intend to use in the main grid.

When you upload on the beta grid, it will claim it's charging you Lindenbucks, but it's charging you beta grid dollars and not money from your actual SL account. Beta grid dollars get renewed periodically; and stuff in your beta grid inventory WILL vanish every so often - it's a test platform and nothing is stable. But it works great for testing your uploaded creations for free.

Once your lovely sale image has been created, it's time to upload it into SL. Make sure you have 10 Lindens (or more) in your account, then go up to the File menu and select Upload Image. A file browser window will open, and you can find and choose your nifty image.

Select it, and an image previewer will appear. If your file is not square, ignore how squished and ugly it looks - that's just the previewer squishing it into a square shape. Accept it, and it will be loaded into SL, into the Textures folder in your inventory. It can stay there for a while.

We'll put it on its prim of the correct shape a bit later.


Creating the box


So much for preparation work. Now we can actually make our box!

Start by right clicking on the ground. If you're on a prim surface, that's okay too. Just right click on something groundlike. You should get a pie menu with Create in the top right corner. If you don't, you're probably in a place where you can't rez things, and you'll need to move to a sandbox, or to land you own.


If you're renting a shop, make sure you have the group tag associated with that shop over your name. (Right click on yourself, look for Groups, select the appropriate group, hit Activate.)



Once you have the right group activated, or are in a place you can rez, left click on Create. This will change your cursor to a magic wand symbol, and open a little window we call the Edit window. (It might be larger than the one in the image on the right - if so, that's okay.)


Look at the top of the menu in the picture. See how the box shape is highlighted? If the box shape isn't highlighted in yours, left click on the box shape, then move your cursor back to the land.




If you want one of the other shapes, that's okay too. This tutorial is based on the box, because it's easiest and this is for beginners. Just choose the other shape instead.


Now left click on the land again. This will give you a lovely plywood box.


Don't worry, we'll change the plywood part later, and we'll also change its shape so it makes your picture look right.



Packing the box

There might be a MORE >> button in the bottom right corner of the edit window. Click that, and you'll get a rather larger edit window.



If you don't have the MORE >> button, you already have the larger edit window. Leave it that way.

Click on the Content tab.

Look in your inventory for the items you want to sell. (If they're rezzed inworld and you want to package them into boxes, you'll need to take a copy into inventory.)

One you've found them in your inventory, left click and hold, then drag the mouse to the large empty window in the contents tab of your prim's edit window. Release the mouse once you're there.

If you have copy permission on the item, this will take a copy of the item and put it inside your prim.

If you do not have copy permission, this will take the copy you selected from your inventory, and put that in the prim.

Setting the box for sale

Now click on the General tab. Fill in the name of the object in the Name field, and a short description in the Description field.


Then go down to the bottom of the General tab. You will see a Show in Search checkbox. You're planning to sell this, so you probably want to advertise it. So click that checkbox and put a checkmark in it. This box only works if you're on land that is listed in Search->Places, but it does no harm to have it checked even if you aren't.



Beneath Show in Search is For Sale. Put a checkmark in that box. That will enable the text box to its right, which is the price text box. Fill that in.


Beneath the price are three options, Original, Copy and Contents.


If you want the box you're packing to be sold - as in, this exact box goes to the customer, not a copy of the box - select Original. Limited edition items are often sold this way.


If you want the customer to get a copy of the box, select Copy. People who sell furnishings often sell Copy: they rez the furniture inworld, and use these settings to have the furniture literally sell copies of itself.



Contents is the most common setting. When a customer buys a box with the 'contents' setting, they get a folder that contains everything inside the box.


Beneath those settings are the permissions. I recommend setting them to the same permissions as the ones you set for the items themselves, back at the start. (in Preparing the items.)


Finally, there's a dropdown menu. It controls what happens when the customer clicks on the box. I recommend setting it to Buy object.

Technically, you could leave it at that. But a plywood box doesn't make a very good product advertisement!


Adding the image



Click on the Texture tab. Once you have, look for the box with the plywood image, and click on that. This will open a browser window for your textures.






Find the texture you want on the box, and select it.










Shaping and placing the box

Select the Object tab. Click on the Stretch button, and then you can see the little red, green, blue and white boxes around your box.

Click and hold on one of those boxes, then drag it towards or away from the centre of your box to shape the box.

If you prefer, you can use the X, Y and Z Size text boxes to enter the exact size you want the box to be.









If your image doesn't stretch with the box, make sure Stretch Texture in the top right corner of the Edit window has a checkmark in it. You can fix a texture that didn't stretch by going to the Texture tab and setting both horizontal and vertical repeats to 1.

Once your box is shaped to the same aspect ratio you made the image at, the image will look right. All the distortions we did will be undone.

Now you have a box that is shaped correctly, use rotation and position tools to place it in your shop.



The Rotate button provides red, green and blue circles around the box, and you hold down and drag each circle to rotate the box around the centre point.

You can also fill in degrees of rotation in the Object tab, at the bottom left.

The Position button provides red, green and blue arrows, which you click and drag. The Position numbers are also editable in the Object tab.



Additional notes

You can sell your objects in 'boxes' of any shape and size. Most people who use this method use rectangular single-prim boxes because it's convenient, easy, and you can put an informative sign on it.

But don't let that stop you from selling goods in teddy bears, lollipops, or bullwhips if you prefer.

Sunday, April 19, 2009

The theory of Second Life skin and clothing

Skin and clothing layers

A Second Life avatar is like a papier-mâché (paper mache) sculpture. It has an underlying shape, which is constructed of a lot of 'lines' and 'vertexes' and looks like a chickenwire framework. And on top of that chickenwire framework, it has several layers of colour - like layers of paper over the chickenwire.



The bottommost layer, right next to the chickenwire, is what we call the 'linden' or 'base' skin. This skin is almost featureless, very few people like to have it visible. It's made inside Second Life itself, and is manipulated in Appearance Mode.

Fortunately, there is another skin layer. This layer was intended for tattoos, and is called the tattoo layer. Now, the skin-makers use it, and paint shadows, highlights, skin textures, and makeup on it. Well, actually, they make textures in the Gimp or Photoshop or some other graphics program.

This tattoo layer is actually blended into the linden skin - if you look at the 'skin' tab in appearance mode, it has three boxes called 'tattoo'. A skin-maker creates textures for the head, upper body and lower body. He uploads them to SL, then creates a new Linden skin and wears it. He goes into appearance mode, goes to the skin tab, and puts the textures in three boxes. When he saves, SL 'paints' those textures onto the Linden skin he was wearing.




So we cover the 'chickenwire' shape with linden skin, then cover the linden skin with a painted skin. On top of that, we put layers of clothing.

You may be wondering what tattoo makers do, if the skin makers have taken over the tattoo layer. Tattoo makers use the underpants/undershirt layer. Tattoos are made with this same technique.

The lowest layer of clothing is the undershirt and underpants. These will cover the torso, arms and legs, but stop at the neck, wrist and ankles. Each garment also stops at the waist.

Slightly above those are gloves and socks, both of which will go past the joint - you can make opera length gloves, and thigh-high stockings with those layers.

Above those are shoes, which can go thigh high but are underneath the pants layer; and pants and shirts.

People who make (or wear) hipster pants have a problem: the shirt layer will never go lower than the waist. So when someone wears hipster pants and a shirt-layer shirt, there's an expanse of belly left exposed. One good solution is for shirt makers to make underpants that match the shirt, and fill in the gap. Another solution for shirt makers is to make their shirts on the jacket layer - but those must always be untucked shirts (jackets cover pants).




The jacket layer is above the pants and shirts layer, and extends down the thigh. Unfortunately, it follows the shape of the avatar, which leads to jackets which curve around the butt and slip into the crack. Most jacket-makers use the skirt layer, or a short 'flexi prim skirt', to solve that problem.

The last clothing layer is the skirt layer, which goes above the jacket layer, and is actually made of its own chickenwire mesh: it's not actually an inherent part of the avatar shape. This leads to another famous clothing problem: huge butts. Most people solve that by having a version of their own shape with a smaller butt.

To actually make clothing, you use the same technique as with making skins. Create an item of clothing (there's a create menu in the inventory), wear it, go into appearance mode, and use the 'fabric' square to select the texture for it.

However, of course, that presumes that you have a texture that does what you want . . .

Making the skin and clothing textures

Many of you who read this will know I already have a tutorial called "How to make SL clothes in the Gimp". That covers the techniques in much more detail than this post will: however, this post is intended to explain the background theory behind the techniques.

Those of you who don't use the Gimp: you can still read my tutorials and get a lot out of them. Or you can check Olila Oh's, Natalia Zelmanov's, or Robin (Sojourner) Wood's blogs, all of which have SL clothing tutorials for that other major graphics program. Links to those blogs are under 'Generous Residents' in the left hand column.

But back to the underlying theory of SL skin and clothing texture-making.



The Gimp, Photoshop, and most other modern graphics programs operate on layers. These are not the Second Life clothing layers - if I need to refer to them, I'll use the phrase "clothing layers".

Think of the layers as a set of transparent sheets of paper, placed perfectly one on top of the other. At any point, you can remove some layers, add others in. You can draw on a layer that's underneath other layers, or on top of other layers. (Okay, it's not a perfect analogy.)

The layers window of your graphics program will look something like the image to the left here. Each layer is represented by the square with the picture in it and the name beside it. Layers which are currently visible (included in the stack) have an eye beside them.

The UV maps - the templates - from Linden Lab, Robin (Sojourner) Wood or Chip Midnight are your maps to the avatar's chickenwire. You put the basic map on one of those layers - one of those transparent sheets of paper - and use it as a guide. Your actual clothing item goes on a different layer.



The image to the right is a layer that's been made white, and above it, the basic map layer. I find that working with a white background makes a huge difference to me - it makes it much easier to see what I'm doing.

Next, you place another layer down. Above or below the UV map, whichever works best. On this layer, paint the basic shape of the clothes you want. It doesn't matter which art tool you use - if this was physical art, you could use a pencil, oils, acrylics, wax crayons, chalky pastels, charcoal. Doesn't matter.

In digital art, use the paintbrush, pencil, airbrush, clone tool, use pathing to make a selection and fill to fill it - doesn't matter. Just put marks on the layer. Use the UV map as a paint-by-numbers guide.

Be a bit messy. Extend the colours beyond the UV map. In my experience, if you don't bleed the colours beyond the edges of the UV map, you get gaps in the avatar seams.

Note: some novice designers try to follow the contours of the UV map in everything they make: this is not necessary! The outline of the UV map is important because it tells you where the avatar body is. However, feel free to ignore the rest of the lines.



Many designers use them as a sort of 'road map' of the avatar body. They (we) decide to make a neckline which starts at this line on the shoulder, and goes down to that line in the centre front chest. Then we use the pathing tool to make a neat curve, and that curve forms the top of the neckline - even though it crosses a whole bunch of UV lines on the way.



The image to the left is a white background layer, a transparent clothing layer that extends beyond the UV maps (but has neat edges at neckline and the end of the sleeves), and above both of those, the UV map layer.

At this point, it's a great idea to hide the UV map and the background layer (click on the eye to make the layer invisible). Then save just the clothes shape as a .jpg or .png and use your clothes previewer (see "How to make SL clothes in the Gimp" for a list of previewers). In the previewer, you can make sure the clothes match up neatly at the avatar seams, and that the clothes shapes - the neckline, hemline, and so forth - is what you were aiming for.

Once you have it correct, save the whole file (.xcf in the Gimp, .psd in Photoshop) so you can re-use the same clothing shape for a different product later. Many SL clothing designers have a library of these with different necklines, different sleeves, different waistlines and hemlines, just to give them a head start on making a new garment.

Once you have the clothing outline correct, you can make the background and UV map visible again, and start making details for your garment. Clothing seams, buttons, fabric textures - anything you want to.

I strongly recommend that you make each of these on a separate layer. If you have the clothing seams on one layer, and the buttons on another, you can't destroy the clothing seams while making the buttons. Also, if you have the clothing seams on a separate layer from everything else, you can just copy that layer to a new outfit to put the clothing seams - but nothing else - on it.

I use so many 'transparent sheets' I sometimes lose track of them all. I keep forgetting to name them sensibly. Learn from my mistake - name your layers! And I never merge them together permanently: they're only merged as part of the final saving process, to get the image I want to upload.



Once you have all the details you want, select the layers that should show in the final product, making only those layers visible. If any of the avatar's skin should show, make sure the background image is not visible - you'll need transparency. (On a garment that fully covers the avatar skin, you can leave the background layer in if you wish.)

Now you save the whole thing as the complete file, to keep every layer of detail available for later use. Then 'save a copy' as well - only this one you save as a .png or .tga for uploading to SL.

The Gimp or Photoshop or your graphics program will merge the layers you have selected for you, leaving you with an image like the one on the right. (Only with the grey checkerboard transparent background.) This is your final product, this is what you upload to Second Life.

And once in Second Life, you use this texture in Appearance Mode to make your shirt. All done! Yay!

For a more complete walk-through of actually doing it, rather than the theory, see my tutorials of making Second Life clothing in the Gimp.