Mesh/Exporting a mesh from Maya

From Second Life Wiki
Jump to navigation Jump to search

Video Tutorial

Chair

<videoflash type="youtube">1fb2LP1n-Lk|640|505</videoflash>

Avatar demo

<videoflash type="youtube">vdjJcjLjHqs|640|505</videoflash> <videoflash type="youtube">vu6bbKQDc7Y|640|505</videoflash>

Basic workflow

Create a box (or monkey or teapot or hippo)

Reduce polygons

Apply textures

Scale to meters

Some features of Maya can go a bit wonky when you change the units from centimeters to meters, so as an alternative, leave Maya alone and build as if centimeters were meters, then after exporting, open the .dae file in a text editor. Find this: <unit name="centimeter" meter="0.01"/> and change it to this: <unit name="centimeter" meter="1.0"/>

It is now scaled correctly when you import to SL.

Export to COLLADA

Import to SL

Best practices

Forum thread on Maya best practices

Bones and rigging

This is only the most basic steps to get your started, but should allow you to have a working, rigged item to wear on your avatar from maya. Once you get the rigged skeleton into maya with the default avatar obj. (or any mesh object) There are a couple of very simple steps:

1. Make sure you are in the animation panel, and have the animation shelf selected. File:Http://img.photobucket.com/albums/v322/macievelli/Rustica Blog/mayarig1.png

2. Position your mesh obj. so that it is as close to your avatar skeleton as possible, scaling where needed. If you are importing the default mesh avatar, the zero point should place it exactly where it needs to be over the skeleton when you import.

3. Select your mesh obj. or avatar mesh obj. File:Http://img.photobucket.com/albums/v322/macievelli/Rustica Blog/mayarig2.png

4. Select your skeleton from the center hip joint (this is the main or "parent" joint for the entire skeleton, and defines the zero position for any animation) Once selected, the entire skeleton should show as selected. http://img.photobucket.com/albums/v322/macievelli/Rustica%20Blog/mayarig3.png

5. Go to the SKIN menu at the top of the maya interface. Select SKIN > BIND SKIN > SOFT BINDING (rigid bind will not work with SL) The small options box for Soft Bind is also where you will go later on to adjust weights and rigging properties. File:Http://img.photobucket.com/albums/v322/macievelli/Rustica Blog/mayarig5.png

6. Once you have selected SOFT BIND your avatar skeleton and the mesh avatar should both show as selected, with the skeleton bones showing a variety of colors. It is now rigged. As a test, you can select one of the bones, like the thigh, and using the rotate tool rotate the leg bone; If rigged properly, you will notice your mesh polygon shape moving along with your bone rotation. Make sure you UNDO this step prior to exporting in step 7 below so that it is back in its original position. File:Http://img.photobucket.com/albums/v322/macievelli/Rustica Blog/mayarig4.png

7. While both are still selected, EXPORT them as collada DAE file. You will need to have the collada plugin installed and running for this to work. Make sure that your UV mapping and any adjustments to the UV map have been done PRIOR to skinning the object to the skeleton.

8. Open SL and import your mesh DAE file, then rez the item on the ground. At this point, most likely it is very small, unless you accounted for the scaling from maya to SL. As stated above: Some features of Maya can go a bit wonky when you change the units from centimeters to meters, so as an alternative, leave Maya alone and build as if centimeters were meters, then after exporting, open the .dae file in a text editor. Find this: <unit name="centimeter" meter="0.01"/> and change it to this: <unit name="centimeter" meter="1.0"/>

9. Import your images texture(s) for the mesh, place it on the item, and take it back into inventory.

10. Wear the item by right clicking it in your inventory and selecting WEAR, ATTACH or selecting ADD to your current outfit. It does not matter where your attach point is on the skeleton, as you rigged the item to the parent hip joint. It will automatically be worn correctly.

NOTE: You will most likely need to wear an alpha underneath the item so that your avatar body will not show through. You may also create a custom alpha texture to apply to the various alpha segments that you check if you edit the alpha clothing item while worn.

Gotchas and workarounds

Optimization techniques

Tutorial links