The SL/OpenSim Skeleton
Collision Volumes (Fitted Mesh)
|The default avatar uses 24 additional so called Collision Volumes. These are simplified mesh volumes for calculating when an object or another avatar is bumping into a character. In fact the Collision Volumes are a set of 24 Octahedrons which get influenced by various shape sliders.Interestingly these volumes are also counted as full bones, and they can be animated and weighted just like the standard bones. The most interesting property of these bones is that they get moved and scaled by some of the shape keys. Weighting mesh clothes or avatars to these bones means they will respond to the Shape keys, for example Torso muscles.But note that only a very small fraction of the Shape sliders actually does influence the Collision Volumes. thus you can not expect to get a full control over your mesh object by using the Collision volumes. For example changing the breast shape is not at all mapped to collision volumes. As well as facial expressions are not supported.
Shape keys influencing the Collision Volumes
This is the list of Shape keys which do affect the Collision Volumes. Please note, the shape keys marked in orange do also influence the Bone length (see previous chapter)
|All 24 available collision volumes:PELVIS, BELLY, BUTT, LEFT_PEC, RIGHT_PEC, CHEST, LEFT_HANDLE, RIGHT_HANDLE, NECK, HEAD, L_CLAVICLE, L_UPPER_ARM, L_LOWER_ARM, L_HAND, R_CLAVICLE, R_UPPER_ARM, R_LOWER_ARM, R_HAND, L_UPPER_LEG, L_LOWER_LEG, L_FOOT, R_UPPER_LEG, R_LOWER_LEG, L_FOOT|
|Besides the 26 standard bones and the 19 Collision Volumes we have attachment points. An attachment point is simply a location where you can attach (wear) other objects. The locations of the attachment points are fixed relative to a particular bone in the skeleton. Thus you might believe that there is not much to say about these points, but technically the attachment points are just another set of bones in the skeleton.Indeed it is possible to animate attachment points in the same way as you can animate the skeleton bones, and anything you’ve attached to those points will go along for the ride with the animation itself. These bones can also be used for weighting custom meshes just like the standard set of bones.
By experimenting with these bones we found some undesirable side effects, which may be due to the fact that weighting and animating these bones has never been seen as a valid option.
The main limitations we’ve discovered are:
|We believe that your viewer should be able to use the attachment points exactly like all the other bones, and thus give us 32 extra possibilities for weighting and animating our meshes, and that the existing limitations should be viewed as bugs. But currently it is not possible to weight attachment points in a reasonable (safe) way.|
What we have so far
|So we have effectively 77 bones available for animation and rigging. Furthermore 20 Shape keys do influence bone lengthes, and 23 shape keys do influence the Collision Volumes. All together (when combining the bone shape keys and collision volume shape keys) we find that 30 Shape keys do influence the mesh and its skeleton provided it is correctly rigged and weighted.So far this is what we found by inspection and experimentation and this reflects our current knowledge about the Skeleton. In the following chapter we will take a closer look on practical issues.||The Skeleton and the associated Shape key system provide:
30 of the shape keys influence the Mesh and/or the Skeleton and thus they can be used for limited customization of custom meshes.
Rigging and Weighting
Lets take a look at an example.
this is a low poly mesh made for game engines. When we want to prepare this mesh for our 3D world, then we have to do following preparations:
- First we need to setup the skeleton itself.
Here we have to take care about the bone hierarchy and about the exact bone names. Otherwise the skeleton is rejected by the mesh importer within your viewer. We believe that you can find an appropriate rig for each of the major 3D editors.
- Now we need to find the best fitting Shape for the character.
- Then we have to add animation data, that is, we have to weight the mesh against the 21 standard bones.
- Finally we have to get our creation into our online world. This is done by exporting the mesh from your 3D editor to a Collada file. We provide Collada 1.4.1 here (This is compatible to 3D worlds which use the skeleton described in this document). The used file extension is “.dae”.
There are some caveats in this process, which might lead to more or less serious issues with your mesh. You have to take care about:
- Your mesh must always be weighted to all 21 Skeleton bones. That is, you have to provide weight information for each bone, regardless whether it is used in your mesh or not. And that means, you have to provide all appropriate weight groups, although they may be empty. If only one of the weight groups is missing, then the mesh will be rejected.
- Your entire mesh must be weighted. If only one vertex is not contained in any of the supplied weight groups, then the mesh will be rejected.
- In most 3D editors you must ensure that your character looks towards the positive X axes when it gets exported. Otherwise you may end up with massive distortions when you wear the character
- If you import a mesh with all vertices weighted to zero, then this mesh disappears as soon as you wear it in the online world. However you can rezz it with no problems.
On a special side note: Although the mesh Importer supports the import of textures along with the mesh, this functionality is currently broken for rigged meshes.
Wearing a rigged mesh
Once you have successfully uploaded your mesh to your 3D world, you can wear it just like any other object by attaching it to an attachment point. However rigged meshes are somewhat special, as you can wear them at any attachment point you like. If the mesh is properly created (weighted) then it will self adjust to the skeleton.
Cancel out the Skeleton Shapes
Here is what you would need to do in principle if you want to create mesh attachments which fit exactly to your in world Shape (attention, this is mind boggling):
- You have to know which shape configuration you use in world. Especially you need to know the values of the 20 Shape parameters which affect the Skeleton.
- You calculate the skeleton configuration which results when applying the shape parameters and setup your skeleton accordingly. This is your working skeleton.
- You setup the working skeleton in your 3D editor and use it to create your mesh attachment.
- When you are done, you have to calculate the difference from your actual mesh attachment to how it would have looked alike if you had created it for the default skeleton configuration. And you have to apply that difference to the mesh. This defacto rebases your work from the working skeleton to the default skeleton. The reason why you have to do that, is that the skeleton shape parameters are already “applied” to your working skeleton. So if you would now simply upload your mesh as it is, then these parameters keep applied and when you wear the mesh, your in world shape will apply the parameters again. And that means your 20 Skeleton shape parameters would be applied twice. Please also note that the default skeleton differs for male shape and female shapes.
- Now you export the rebased attachment to your 3D world.
- Now you can wear the mesh. And if you also wear the correct shape (which you used in step one above) then the shape parameters get applied to the mesh and it now fits 100% and looks exactly like you created it in your 3D editor.
We are proud to tell you that our Avastar product does all of that for you automatically in the background. So you do not need to bother with this at all. But it may be good to know about that issue when you intend to create your own mesh exporter tool.