Fitted Mesh Kit

fitted_mesh.Blend for pure Blender (2.70 and newer)

This page is only for users who do not(!) have Avastar.
Avastar users: Please ignore this page!

We have created fitted_mesh_270.blend (based on the example files provided by Linden Lab) with a female and a male mesh, a correct SL compatible skeleton, 2 bonegroups for SL Base Bones and Collision Volumes.

Sidenote for experts: All versions of blender older than 2.70 can not create Collada Files that work with fitted Mesh, because Blender does not support a customizable Restpose Matrix (or bind pose matrix) as it is available in Maya.

Quick Guide: How to Get the mesh to SL

Step 1: Open the file in Blender

  1. Open the file fitted_mesh_270.blend in Blender 2.70 or newer
  2. Either open Layer 1 to view the female mesh (default) or open layer 2 to view the male mesh.
  3. Select the Mesh in Object Mode (RMB)
fitted_mesh_01_thumb

Open the Blend File (Click image to zoom in)

Note: The skeleton (Armature) is located on Layer 10. You can ignore the skeleton for now, the exporter takes care of it when it needs it (see below). If you want to see the Skeleton together with the meshes, then you enable additional layers by using SHIFT LMB (Left Mouse Button).

Step 2: Open Blender’s Collada Exporter

  1. File -> Export -> Collada (Default)
fitted_mesh_02_thumb

Open the File Exporter (Click image to zoom in)

Note: If you have Avastar, then please use the Avastar Rig and the Avastar Collada exporter. Avastar does a lot of special calculations in the background (regarding bind pose matrix, correct rotation, scaling, etc.).

Warning: Never export the Avastar rig with the Blender Collada exporter unless you know exactly what you do !

Step 3: Set the export options

  1. From the Operator Presets select the Preset “SL +OpenSim / rigged”
  2. Specify the export location
  3. Export Collada
fitted_mesh_03_thumb

Prepare Export settings (Click image to zoom in)

Note: You find the operator presets at the bottom of the tool shelf (on the left side)

Step 4: Upload to SL

  1.  In the SL Viewer: Build ->Upload Model
  2. take care to enable Include skin weights You find this option in the Upload options tab of the SL Importer.
  3. Calculate Weights & Fee
  4. Upload
fitted_mesh_04_thumb

The SL Model Importer (Click image to zoom in)

Note: When you enable skin weights on the preview display (see image) then you often see that the mesh turns partially invisible. This seems to be a previewer Bug. The goods news is: We always found that the uploaded Meshes work properly and do not show these invisible parts.

In depth information (a bit technical)

Note: Avastar supports Maya’s bind pose matrix since we added support for Liquid Mesh (collision volume weighting). So Avastar always supported (and still supports) Fitted Mesh out of the box and independent from the Blender version.

The skeleton (quick Info)

  • The meshes are ready for export with the default Collada exporter. Please use the export option “Export for Second Life”, otherwise your export will fail immensely!
  • The blend file has 3 layers populated:
    • Layer 1: The Female Mesh
    • Layer 2: The Male Mesh
    • Layer 10: The Armature (Skeleton)
  • The meshes are fully weighted to a mix of Collision Volumes and SL Base Bones (as proposed by Linden Lab). All bones have been enabled as deform Bones.
  • All mandatory weight Groups have been added.
  • The meshes are rotated according to the SL conventions (i.e.: looking towards the scene’s positive X-axis)
fitted_mesh-bone-layers

Where are the Collision Bone weights ?

These weights are stored in Bone weight groups. You find the weight groups in the Vertex Groups Panel (in the Object data Properties of the meshes). You probably want to modify the weights. they are not optimal.

Note: You can see the weights in edit mode (you need to enable the “Show Weights” option in the Mesh display panel).
fitted_mesh-bone_weight_groups

So how would i do weighting in more detail ?

Now it gets a bit fuzzy 🙁 However…

You have to take into account that many vertices of a mesh are typically weighted to only one single bone. Actually you “only” have to take care near the joints where you typically get 2 weights per vertex, in some cases 3 weights (as mentioned above for parts of the shoulders) But lets try to start easy (which is already complicated enough)

Vertices with one single weight

Most Collision Bones are immediate children of SL Bones. Hence when an SL Bone moves, then the corresponding Collision Bone follows tightly this movement. Hence it does not matter if you weight a vertex to only one SL Bone or if you weight it only to its corresponding Collision Bone. The character’s animation will work exactly in the same way for both cases (  Remind: This is true only when the vertex is weighted to a single bone ! )

But the mesh will react differently on the apperance sliders! as mentioned above: vertices weighted to SL Bones are influenced by other appearance sliders than vertices weighted to the Collision Bones. So its your decision what you want for a particular area of your mesh: either bone length changes or mesh morph changes (or a combination of them)

Vertices with 2 or more weights

Now it might get a bit tricky. You Still can weight to the collision volumes. This might give reasonable results. In fact in most cases the results are OK.  However you might get curious and maybe you want the area around the joints to keep following the SL Bones. (and have no weights going to the joint areas to Collision Bones) In this case the mesh keeps nicely scaling with the Skeleton Sliders. But i am not sure if this is realy necessary (will update when i played with this a bit more)

So and what about the in between vertices ?

If you weight the joint areas to the SL Bones and the middle of the bone areas to the collision volumes, then you will have to define a weight transition from an SL Bone to its corresponding Collision Bone (the more you approach the middle of the bone, the less weight is put to the SL bone and the more weight is put to the Collision bone). After all the middle of the bone will follow the morph sliders and the joints will follow the Bone length sliders. And the transient vertices will follow a mixture of both. That should work in theory… Now lets go and practice 🙂

Ok, admittedly fitted Mesh creations are not an easy task. Maybe as a rule of thumb you can keep in mind that we have Skeleton Sliders for the SL Base Bones (also named mBones meanwhile) and Morph sliders for the Collision Bones (cBones). Eventually you have to decide which part of your mesh shall follow which set of bones.

There is no easy either this way or the other. It is all a matter of finding the right blending.

Technical details about the Bind Pose matrix

The Bind pose matrix essentially allows to define a Pose for each Bone that will be treated as the rest pose. In Blender the rest pose is defined by how the skeleton is arranged in Edit Mode. thus Blender’s Bind pose matrix is always the identity matrix.

I have defined a set of properties which can be created as custom properties of the edit bones. If the properties are available, then the Collada exporter will also use them. If the properties are not available, the Collada exporter will fall back to use the identity matrix (as it did all the time before). The properties are:\

restpose_loc_x (default=0.0)
restpose_loc_y (default=0.0)
restpose_loc_z (default=0.0)
restpose_rot_x (default=0.0)
restpose_rot_y (default=0.0)
restpose_rot_z (default=0.0)
restpose_scale_x (default=1.0)
restpose_scale_y (default=1.0)
restpose_scale_z (default=1.0)

Note: This may be changed in the future as i will propose to add the Bind Pose matrix as an official Blender feature. This might possibly allow us in the future to bind a mesh to arbitrary poses with no extra work.

fitted_mesh-bind_pose_matrix

Important: I found by experiment that for the SL Importer we only need the restpose_scale and the restpose_rot properties. However, since Linden Lab has provided the complete rest pose matrix, i have kept the restpose_loc properties in the blend file, but i renamed them all to “_restpose_loc” (with a leading underscore) to hide them from the Blender Exporter.

You find the properties when you place the armature into Edit Mode. then the values show up in the properties sidebar, and they can be edited in the Object Properties window.

29 Enlightened Replies

Trackback  •  Comments RSS

  1. Jessica Williams says:

    How can I get the female form It only gave me the male.

  2. Yogich says:

    Well..I don’t know what I missed, but I finally got it to work & uploaded. The result was disastrous & incredibly, funny. Bore no resemblance to a human, whatsoever, once attached to existing avi. lmao

  3. Yogich says:

    Hi..

    This is supposed to be a 1, 2, 3, 4, operation and I am having problems: all the steps seem to work, up until trying to Export, using Collada (Avastar) –it is greyed out. I have the paid version of Avastar, installed.

    Something, is amiss.

  4. Lyriga says:

    Hi, I do not have Avastar. I have workbench.. and it seems right blender version. I also have make human and run on win 8.1.. its a laptop, but one for gaming so it should do. Anyways. I have created a test shape at makehuman and further edited her in blender for further cause the face and breasts on makehuman arent very pretty.. or large enough.. and yes I worked on the butt and other parts too. I kinda got into doing more and more for it at the work bench cause I have no idea how to upload the crap to SL. There exists tutorial videos for avastar, but nothing about work bench to find. Actually I would like to know if its possible to do directly.. even if the makehuman really isnt perfect after it has done what it can.. as is.. generate a shape to edit so I do not need to start from the cube. I am far from a pro – I do not even understand all the words when speaking about blender. But I claim there really is nothing good enough that I have found there on web to teach me either. The reason why I want to make a mesh avatar is the simple fact that there is always something I do not like about existing mesh the avatars and clothes on SL. Mostly it is about them not being compatible and that they require me change my shape. I want a shape that I have full control over – for what I can make the clothes that I imagine to wear, exactly the way I vision them. That would be so cool. I can do textures and I could edit or make prim clothes without pain – but the mesh thing – well when it all became popular – I lost my ability to enjoy shopping, creating new looks and generally be me with my style. I want my fun back. So I really would love to see or find a full out tutorial about how to get for example makehuman origin mesh avatar that has been worked on at blender workbench to SL. I would appreciate if it was done by someone who does not forget about how to set up the working environment of the program to start with. And yes I would love if that avatar reacted to sliders and had physics ability – but I dont really consider those as important as to have the shape I want. I have one time managed to drag a pair of mesh boobies into SL from blender. But I had to save them first as object and then turn that into dae to even be able to make it work. I did that cause I wanted pair of boobies that would not stick out from my back cause someone made them out of tear shaped mesh, or that was not invisible from behind, such that you would see through them from certain angles – but it was not rigged or anything. I do not remember how I did that, except that I cut the part out from a copy of my avatar.. and had to remove some few layers of avatar.. idk how many exactly. Well that should tell you how little I really know, and why it would really help to find some sensible tutorial.

  5. joe rozenblum says:

    great work! thank you very much for your effort with the blend file.

Post a Reply

Your email address will not be published. Required fields are marked *

Top