HOW TO CREATE AN ALPHA MASK USING BLENDER FOR SECOND LIFE MESH CLOTHING

Recently, I posted a project  I have been working on.  Today, I am going to take it a step further>..LOL yes, I am a bit slow.  A BIG THANK YOU to Gaia Clary and her wonderful Avastar/Blender videos, and Eleanora Newell, a wonderful volunteer in the the Blender Jass/Primstar, Blender Avastar, and Mesh Studio groups in Second Life.  Thanks to both ladies, I was able to rig and import this dress into Second Life and woo hoo, it worked!

Okay, I have to confess; it sorta worked. This is by no means the fault of Gaia or Eleanora.  Bits of me are sticking out of my dress, there is some sort of fold error at the hem, and there are some further tweaks I need to make in Marvelous Designer and in Blender. But, all and all not bad for my first try as a hobbyist! 

Figure 1 is the front view of the dress I created.  This is a rigged, fitted, mesh dress created in Marvelous Designer and rigged in Blender.  Please note, my avatar is not the same size as the default Second Life Avatar so you will notice my bits  are poking out of the dress...see the red areas on the upper body?  

Figure 1

Figure 2  shows the back of the dress. Not so bad in the upper back area but the hips, gack.  No, I didn't forget the alpha.  We are going to make, which is really the whole point of the article.  I just wanted to show you what can be done with a bit of patience and perseverance.

Yes, I know I need some new shoes!  Anyone have some nice pumps I can wear without feet I don't have to try to recolor or those tippy toe feet?

Figure 2

My next step for this dress is to figure out how to weight painting the darn thing.  People say it easy...ha, I say!  Tis not!  So, hang on for that in another upcoming adventure in the near future.

If you are unfamiliar, weight painting helps the mesh move with the avatar.  So, I skipped that part for now and went to the next step of creating my alpha mask in Blender.  Actually, I could spend some time to make the alpha layer in Photoshop or Gimp using Chip Midnight or Robin Wood layered clothing templates but, if I can do it in Blender, why add another step to the process?  I have a feeling it might be a bit frustrating and time consuming for my limited patience as this point; I have never been the greatest in making layered clothing. But, with something I can start from, I will be able to do some tweaking to the mask after I create the base in Blender.  Is much better at tweaking!

ALPHA MASKS AND VERTEX GROUPS

The video URL below demonstrates how to create, in Blender, an alpha mask using Vertex Groups and the Mask Modifier. This works for both fitted and classic mesh clothing for Second Life. The version being used in the video is somewhat older, but the principles are the same.  You should be able to use the same principles for other non-Second Life related project.

IMPORTANT

Before we get started, you need to know this bit of information before you get started.  I did not know this and could of saved myself a bit of frustration if I had know.  Thankfully, Eleanora Newell, steered me back on the path so, I have updated accordingly.  PLEASE READ IF YOU ARE USING BLENDER 2.70 AND AVASTAR  You can find complete information on this and much much more about Avastar and Blender on on Gaia's blog.  Here is a direct link to the specifics.

http://blog.machinimatrix.org/avastar/help/classic-fitted-tips/

"If you want to use Blender 2.7, then at present, Avastar-1.1 is still in the alpha stage.  To be up to date, always use the highest numbered Avastar which at this time is avastar-1.1-alpha-26_blender-2-70 (which can be found in the main inventory area and in the test folder of your download page).  Please review the changelogs and check this page frequently for newer updates."

Also, here is the direct link to Gaia's video tutorial on making Alpha Masks this article is created from.


You can view the entire original transcript, for Gaia's video, at the end of the article.

Please Note: The credit for the instructions listed below goes to Gaia and anyone assisting her. The basis for the instructions are from the original text transcript of the video on Gaia's Clary's Machinimatrix Blog. I merely added to the brief instructions for further clarity. Mainly, this is a reference document for ME so I don't have to keep referring to video all the time while I learn all the stuff you need to know about making Second Life Clothing.  Heavens, it's really is cheaper and much less frustration to buy someone else's full perms mesh and go from there! But, where is the fun in that?

How to Create an Alpha Mask Using Blender Instructions.

These are “start from scratch” instructions, which means I don't have a project already waiting in Blender.  If you have one waiting for an alpha you can skip some of the initial steps. 

Before you start...
  • These Instructions were written for Blender 2.70 and Mac so if any of the pictures look different from yours that is probably why.  However, the instructions should operate the same for the PC version.
  • You will need to use an unwrapped Avatar model so you can see the UV maps in the UV Editor.  If you don't have Avastar, then check Gaia's blog for the workbench model both have already been unwrapped.
  •  A good suggestion, (Thanks to both Eleanor Newell and Haven Ditko for reiterating this) is move your mesh, and rigging to separate layers from your model.  Why? Sometimes, you may wish to turn off the clothing layer to see what you have selected on the Avastar model. Much easier, less frustrating, and less chance for accidentally selecting your mesh. Not to mention, the rigging just gets in the way sometimes. 


CAUTION: What I have created may have errors, I have not tested the steps completely after they were written.  I will do that another day since I have already put in quite a few hours on this project. I am pretty sure it is accurate, although it is wordy because the instructions were written for my reference only. I am just sharing it with you to be helpful.

To be sure you have correct information, please watch the video and follow along as you go.  Practice a few times BEFORE you go to work on your projects.

INSTRUCTIONS:
  1. Open Blender and add your Avastar model. Or, open a previously saved Blender file that has your mesh you want to create the alpha mask for.
  2. If needed, import your .obj file for the mesh the alpha will be created for.
  3. In Object Mode, select your rigging, Hit your M key, and move it to a new layer. Do the same same for your mesh.
  4. While still in Object Mode, select the body part of the Avastar model you want to create the alpha mask for. While it wasn't very clear, I believe you will need to work on uppers and lowers separately since we will be baking this later on for export.
  5. Tab into Edit Mode.
  6. In Edit Mode...BE SURE you Deselect ALL using A before you begin or you may have some disasteous results like I did the first time through.

    You may want to turn on your UV Editor window now.  Why?  Because what ever parts of your Avatar is selected, those selected areas will show up in the UV Editor window.  Helps to double check your mesh.

  7. Select only those faces, on your Avastar model you wish to keep visible with your clothing. (i.e.what part of the SL Avatar do you want to show like skin or undergarments). If you want the alpha mask to hide something, then DON'T select those faces.
  8. Once you have all your faces selected, Go to the Properties Panel (far right), Click on the Data: Object Data icon (looks like a triangle made of three dots and 3 lines) to bring up a new panel of choices.
  9. In Vertex Groups, you should see a number of pre-existing vertex groups. Please leave those alone!  To create a new one, click the plus sign (+) along the right side of the Vertex Groups Panel and it should create a new Vertex called Group (Does this in 2.70) in the Vertex Groups panel.
  10. With the Group still highlighted, click on the teeny tiny plus sign under need the Vertex Group box. It will pop open a dialogue box where you can rename the group you just made.  Name the group so it makes sense to you, like Alpha Mask Upper or, Alpha Mask Lower then Hit Enter to accept.

    Keep the Weight: 1.0...This is a default...leave it at 1.0. 
  11. Now, click ASSIGN.

    It is very important you hit ASSIGN in order to assign the default weight to the new vertex group you just made. When in doubt, click the button again!
  12. Back in the Viewport, A to SELECT ALL vertices. The entire UV mesh for that body part should be showing in your UV Editor.
  13. In the Properties Panel (far right again), Select the Modifiers: Object Modifiers icon (looks like a small wrench)
  14. With the Modifier Panel now open, we are going to add a Mask Modifier. Press Add Modifier button at the top of the Modifier Panel, mouse over to the Generate column, select Mask.
  15. DO NOT APPLY your modifier!!! It is not necessary to apply the modifier, only have it enabled will we make our alpha texture.  
  16. We need to assign the Vertex Group we just made to the Mask Modifier. Click in the Vertex Group: field (NOT the Mode:Vertex Group) and click on the vertex group we just made. The name of the group you made should populate the Vertex Group: field when you select it.
  17. We should view this to make sure this is what we want. Click the little odd looking sideways cube with 4 dots. Then click the inverted triangle next to it. This should show what your alpha mask will cover and hide on your avatar when brought into Second Life.
  18. DO NOT APPLY the modifier.
  19. Go to your UV Editor.
  20. From the UV Editor menu, click on IMAGE and create NEW IMAGE. 
    Since we are not worried about resolution with an alpha layer, change the Width to 512 and Height to 512. 

    Alpha should be checked by default. Then click ok.
  21. In the Properties Panel (far right) click on the Render:Render icon (looks like a small camera). We need to bake our image before we can export it.
  22. Scroll down to BAKE, which seems to be closed by default or, it is on my viewer.  Click BAKE it to open the panel. You amy need to scroll down more to see all the settings in the panel. 
  23. By default Bake Mode: Full Render. We need to change this to  Texture. Click on Full Render and another drop down should pop up.  Select TEXTURE.

  24. Now, you need to Click Bake

    What your UV Editor window, this may take a few moments for Blender to process and turn the areas that WILL BE VISIBLE WHITE.
  25. Under UV Editor menu, Select Image then click Save Image As
  26. A new screen will appear. Select where you wish to save your image to. I generally save mine to my desktop. Name your image. By default, the image will be saved as a .png, which is what we need for Second Life. Click Save As Image.
  27. You are now ready to upload your new alpha layer texture to Second Life.  Once in-world, you will need to create a New Alpha Layer in the Edit Outfit section of your viewer. 

    If you have never done this before, be sure you place the image on the correct area in your alpha layer.  It is easy to drag your texture to the wrong slot if you are not paying attention.

    An alpha layer, in Second Life can hold multiple textures. 

    DO NOT put a check mark in the small boxes underneath each of the allowed area.  Doing so will turn off that alpha texture.   Save it as you normally would any piece of layered system clothing...be sure to give it a name.  You will find this saved item in your inventory in the System Clothing folder.
I don't know how or even if you can add a nice text divider to a blog; thus, Gaia, your original, verbatim text is pink!  

Create An Alpha
Gaia's Clary's Machinimatrix Blog
http://blog.machinimatrix.org/create-an-alpha-mask/

Video Transcript
Hello and welcome to a quick tip for creating an Alpha mask for a Second Life Avatar. I assume you have a uv unwrapped Avatar body at hand. You can use the Avastar character or the character from the Avatar-workbench. The shape of the avatar does not matter.
  1. open your mesh in edit mode.
  2. Select all faces which you want to keep visible.
  3. Create a new vertex group and assign the selected vertices with weight 1. Then select all vertices.
  4. Add a mask modifier and assign the just created vertex group to the modifier. Check that the mask works as expected.
  5. open the UV editor, or go to the UV screen layout..
  6. Create a new image with Alpha channel..
  7. open the render settings and bake the texture..
  8. transport the image to Second Life and create your alpha mask..
Thank you for watching.


Yay, that took longer than I expected for a 2:45 video! But, for me it was worth it. Learning by doing is my thing!  LOL...takes me longer than most, but who cares!  

Really, the hardest part of doing this is deciding what faces to select for the item I made.  It can be a slow tedious process. After I finished selecting my faces, it went really quick. Once you get use to the process, you can refer to Gaia's much shorter instructions to key your memory.

Happy Creating,
Morgaine

Comments

Popular posts from this blog

SECOND LIFE MODEL IN A-POSE FOR MARVELOUS DESIGNER

BLENDER-IMPORT IMAGES AS A PLANE-CYCLES RENDER

MAKE MEDIEVAL ARCHES & VAULTS IN BLENDER