|
Avastar has a number of tools to help working with custom mesh. We also provide a free Blender addon, independent of Avastar, fixing Blender’s Collada export (see bottom of page). The tools can be found in the Tool Shelf panel of the 3D view and they are arranged roughly in the order of workflow – from mesh creation, weight assignment and adjustment, to export. |
|
Freeze Mesh Tool
|
Selecting a mesh like upperBodyMesh will make available the Freeze Mesh tool. This tool will create a copy the selected mesh freezing the current shape and even the pose into the vertex data. You can use this as the start of a custom mesh avatar, or for mesh clothes that will have the same vertex structure as the body, or for an entirely separate mannequin or statue. The bone weights and UV-maps are also copied across. Once you have the new mesh, edit it as much as you want using Blender’s mesh tools and export it as a mesh object. |
Setting Hide Original Mesh with do the obvious – hide the original Avastar mesh. You can delete these meshes if you are not going to use them but you will lose the ability to set the shape via sliders. Note that the shape is taken into account in the frozen shape, including facial expressions and hand morphs. By default the frozen mesh will be parented to the armature, which, together with the bone weights, will mean the mesh will follow the armature’s pose. Setting Standalone Posed will create a separate mesh suitable for a statue or mannequin that will have the current pose baked in. |
Weight Copy Tool
|
If you select a mesh and an Avastar avatar a new tool becomes available in the Tools Panel called Weight Copy. The tool uses the visible default Avastar meshes to transfer weights from, so first hide any meshes you do not want to use (like the Skirt and Hair meshes). Then position the new mesh to match Avastar’s this is best done in the T-pose, though we also have a tool to correct for a non-standard pose (see below). |
For every vertex on the new mesh, the tool finds the closest vertex on the visible default meshes and copies across the bone weights. The algorithm takes into account the shape and pose of the default mesh. For best results the custom mesh should have approximately the same vertex density as the default ones, and you should match the shape as closely as possible. Before transfer you can edit the default meshes using the shape sliders or the usual Blender tools to get a better fit. As long as you don’t change the structure of the default meshes their shape can be reset simply in the Shape Pane later. If you don’t plan on using the default meshes further they can also be deleted. If you wish to transfer weights to only a few vertices then select Only selected vertices and select the target vertices is edit mode. Clicking Copy Weights will transfer the weights replacing the previous weights on the selected vertices. Existing vertex groups will not be removed, these can be easily removed in the mesh tab of the Property Editor (look at the down triangle menu to the side of the Vertex Groups list). You can see a summary of the action on the console. |
Weight Adjustment
|
The Weight Adjustment box has a number of tools that depend on context. |
For convenience there is a Normalize Weights button that will be available whenever a mesh is selected. This will make sure every vertex has weight 1.0. Errors (like an unweighted vertex) are reported on the console. If a mesh is the active object, then the Find Unweighted button is available. This will examine all the weights in the mesh and report the number of vertices with 0 total weight on the status line and console. If some unweighted vertices are found, the mesh is dropped into editing mode with the unweighted vertices selected. Finally, if a mesh is active in edit mode then the weight inspection tool appears. With a single vertex selected this contains 4 fields showing the bone names and their weight (the SL mesh supports up to 4 weights per vertex). When you change the vertex selection it’s important to press the Refresh button at the top as Blender will not automatically refresh the values. The bones names and weights can be adjusted, and new normalized values written back into the vertex with Apply. Weights can be added and removed also. When multiple vertices are selected the displayed values will be blank but any entered weights will be applied to all selected vertices with Apply. Normalization is done automatically. |
Non T-Pose Rigging
|
Sometimes some pose other than the default T-pose is more suitable for rigging. Maybe the mesh model is non-human or came from another source that had different rest pose; or maybe in clothes design you want to get the drape right in a more natural pose. Assigning weights is easy in any pose. The Weight Copy tool above will take into account the pose, and obviously weight painting and manual adjustment of the weights doesn’t care what the pose is. The problem is that for animation SL imposes a default ‘zero’ position which is the T-Pose. So any bone rotations away from the T-pose will move the vertices of the mesh that have non-zero weights for those bones. To fix this, we can ‘bake in’ the current pose into the positions of the vertices. Think of this action as posing the mesh in edit mode from the current pose back up to the T-pose. |
The tool will become visible if a mesh and an Avastar armature are selected. The Parent To Armature option will automatically parent the mesh to the armature after the mesh has been deformed. Warning: this tool will modify the mesh data! While you can use Blender’s undo, it’s a good idea to ensure that you have made a backup of your work in case something goes wrong. Also ensure that the mesh is properly weighted as it is this data that will be used to modify the mesh. When you hit Bake T-pose each vertex of your mesh will be shifted so that it is correct at the T-pose. If the Parent to Armature is selected you should see no change (in effect the mesh vertices where shifted up to T-pose and then shifted back by the pose itself). Test out the weighting by changing the pose. |
Collada Export
This will export your mesh as an SL compatible Collada file. Currently it runs the same algorithm as the addon described below.
Free Blender Collada fix addon
|
Blender’s Collada exporter produces incompatible files for second life at the moment (Blender 2.59 and newer). This appears to be a miss match in co-ordinate systems for the bones. Attached is a python script that attempts to fix this. The current version of the script uses the Armature tweeks as proposed by Masami Kuramoto and supports the export of Meshes from Avastar. Note that it has only been lightly tested. So backup your work first! That said it has proofed to work fine so far. Features:
Warnings and Hints
|
Installation instructions:
Usage Instructions:
|





Thankyou! Avastar is brilliant! ♥
@ Gaia
Where can i find the Weight Copy Tool and the Non T-Pose Rigging. I would like to make my mesh shirt work in second life but the program i used it in has a slightly different pose on the Shirt. Also i am confused how to make the first rigged to fir and move along my avatars body
Just released
The tools are available as part of Avastar-1-dev-376.
your hard work is greatly appreciated, gaia. i hope this helps me with my problems. :X
when you get time… can you place what version/s of blender the plugin/s work with? i saw them listed on your sl blogrum post, but not here on this page. would be helpful (or even vital) for folks to know what version/s these work with. thanks!
Those extra tools aint showing for me – For example I load up an avastar, tweak the morphs to match my shape, select the upper body mesh and pull up the tool shelf looking for the freeze tool… no sign of it. Went looking in all the rest of the UI to make sure it hadnt been added somewhere else.. still no joy. Tried a clean install of blender and avastar – no change. Any idea what is fouling up here?
Blender 2.61 win7 64bit, avastar 1-333
Sorry, my bad. The docs are ahead of the code for once. I was hoping to release the update earlier but I’m still doing some tweaks and modification. The tools will be available in the next update soon. Sorry for the confusion.
No worries – those are sufficiently awesome in what we can do with ‘em that they are worth waiting for
Looking forward to the next avastar
Okay, I have it installed and theoretically working now–working inside Blender anyway. But it’s not exporting correctly. If I export just the weighted mesh, it comes out completely distorted when I upload it to SL. If I try to upload it with the Avastar skeleton, it gives me a .dae parsing error. I’m using Blender 2.61 and version 1.4 of the SL Collada export script.
The version 1.4 does not work with Avastar. Please update to SL Collada 1.10. That one is optinized for Avastar. If nothing helps, i offer to take a look at the blend file.
The Blender Collada fix doesn’t work for me in Blender 2.61. The model still comes out with the wrong rotations. I’m using version 1.4 of the Blender Collada fix.
have you disabled “Rotation z-90″ ?
If so, then i offer to take a look at the blend file.
Yes, I tried with and without it checked. The same general Blender 2.61 bone rotation error occurred. I’ll try to make a demo model tomorrow and send it.
I just tested the SL Collada 1.11 version, and it is working. Thanks.
(So, ignore the previous comment.)
I’m apparently doing something wrong, but I can’t figure out what. I’ve been trying to create a full body replacement mesh, and when I export it using 2.49b, it comes out as expected, but when I export it with 2.6, the left arm is correct, but the rest of the body parts are all rotated wrong. I thought maybe it was the problem that you fixed with this exporter, but I tried using it and it still comes out like that.
I applied the rotation of the armature in Blender, using the Blender orientation, but when I import it, like, the right hand is facing 180 degrees from what it should and the legs are at an odd angle, and the feet are pointed to the left and the chest and pelvis are rotated 90 degrees…
Its just really, really weird.
It could well be that your objects have non applied rotation. If that is the case, just apply the rotation before you export. If this is not the problem, then i offer to take a look at the blend file.
Worked for me Kent.
Right click > save link as
I have a stupid question… how do I use it?
I installed python.
The only instruction in the notes at the beginning is “Usage:
blender-mesh-fix.py mesh.dae
will generate the file mesh_slfix.dae with fix applied”
I’ve been Googling for how to run a python script in Windows, but nothing I’ve found works. Most of it doesn’t make much sense to me, though. They say things like “follow your nose.”
Do I have to change something to make it work in Windows?
With SL Collada-1.4.py (see above) your problems should be completely solved. “SL Collada” is an addon module and thus fully integrated in Blender.
blender-mesh-fix-1.py
I just click cause appear all text then I click back and right click download did not work download, you might need compress to be .zip will work automatic download.
I show you picture http://www.pasteall.org/pic/23471
thanks
[...] I’m currently using Blender 2.61 and that still happily imports and exports COLLADA and there is no reason why I won’t be able to carry on using version 2.61 in the future. However even if Blender does drop support, there’s nothing to stop people supporting COLLADA in Blender, indeed resourceful Second Life user Gaia Clary is already on the case and has posted a SL COLLADA 1.8 update, designed to work with the Avastar system. [...]