New-Media-Arts-New-Viewer-Avatar / OpenSim-Avatar

Research Results for the current default SL/OS viewer avatar.
Other
7 stars 1 forks source link

MeshAttachmentWeightingReference.ods #1

Closed AdaRadius closed 1 year ago

AdaRadius commented 1 year ago

The tables in this spreadsheet show information from the viewer for the Appearance shape sliders. They are for mesh attachment designers who would like to look at more technical data when things go wrong with our vertex weighting, particularly for fitted mesh and Bento faces. I used LibreOffice Calc; it should open in nearly any spreadsheet software. Tom Ernst, AKA Owl Eyes helped me a great deal with this; better ways to represent xml trees in a spreadsheet. We collaborated on researching the functions of the xml elements and attributes. He will eventually replace these sheets by generating the data directly with an ap.

I wanted a better reference to see what, exactly, is going on when I rotate, move or scale a bone (Pose mode) in Blender, how my weight painting will affect the Appearance shape sliders inworld, and how it relates to the system avatar underneath. I tend to work, now, with a copy of SystemAvatarReplica (a blend file in this repo) in my working file, and consult with the lists in this spreadsheet as I go.

I have looked at all of the SL Wiki's on avatars, along with dev logs, plugins, blogs and any other information I could find. And found too many inconsistencies, missing information, and errors. In fairness, most of the official documentation was written after the dev was done, by volunteers who had to guess as much as I have as to what the original developers had in mind. Tom and I are still figuring some things out. We'll update as we can.

All of the data in this spreadsheet came from the viewer Character folder, in avatar.lad.xml (Linden Avatar Data) and avatar_skeleton.xml. You can read the xml files directly, in any text editor, XML editor, or a browser, in its tree format. This spreadsheet has only part of the data from the xml file - the shape slider information plus anything else that has bone parameters.

General information: The Appearance sliders move the system avatar and the mesh attachments at the same time.

For system avatars, most of the Appearance sliders move mesh morphs. The system basemesh and the mesh morph data are in the llm (Linden Lab Model) files in the viewer Character folder. The mesh morphs are often in pairs - for example, one to increase and one to decrease size of a body part. You can take a look at them in ViewerAvatarReplica.blend (proof of concept) in this repository.

A few of the sliders move the 17 basemesh mBones, as well as mesh attachments, to change the length or width of limbs or parts of the torso. These work even if we've checked "include joint positions" on upload.

Mesh attachments morph with the 159 mBones and volume bones, depending on how we weight vertices to the bones groups in our mesh. One big difference between weighting in the system avatar and mesh attachments, is that the system avatar is limited to 2 bone weights per vertex, and mesh attachments can use 4 bones weights per vertex. We the collision/volume bones if we are rigging for "fitted" mesh.

So if your mesh attachment doesn't fit the system avatar, these are the reasons why: System avatars morph with morph meshes plus 17 bones for a few skeleton morphs, and only carry 2 bone weights per vertex. Mesh Attachments morph with 159 mBones and volumes, and carry 4 bone weights per vertex.
The bone hierarchy for the torso is different for the system avatar than for mesh attachments, because of the mSpine bones.

There are workarounds of course, especially alpha layers. Which unfortunately lag both servers and viewers and should be minimized if possible.

There is a limit to how many vertex groups we can upload with each mesh piece - 110 - which takes even more planning in your topology, rigging and skinning.

The sheets: xml data by shape slider:

Column A: the driver name, which is also the name of the Appearance slider. In the xml data it's usually attribute label=, unless there's no label, then it defaults to name=, the name of the parameter. If this feels as though you've slipped into the Humpty Dumpty scene in "Through the Looking-Glass", you're not wrong.

Column B: female or male, if the slider is only for one or the other

Column C: the id number of the driver

Columns D - F: The overall slider ranges. Most of this is straightforward, a few are unexpected numbers that seem to compensate for morph topology or bone positions that didn't produce a desired result with default values. There are also value ranges for the underlying mesh morphs or param_skeleton that may differ from the driver value ranges.

Column G: xml attributes, e.g. what kind of data is in this row: param_driver: Appearance slider name, id number, sex, value ranges param_skeleton: armature driven morphs and value ranges param_morph: mesh morphs used only for the system avatar. In green italic. bone: mBone, mostly for mesh attachments. The ones used for both the system avatar and mesh attachments are in bold blue. volume_morph: volume bones, only used for mesh attachments param: anything else not otherwise labeled

Column H: The eyelash system basemesh and morphs share settings with the head. This field links which ones.

Column I: The id numbers (id= in the xml data) for the parameters driven by the drivers listed in column A. The simpler sliders only have one id.

Column J: Comments from the xml file. A little insight, sometimes.

Column K: name of the mBone or VOLUME

Column L: Bone scale multipliers. We can see how these are working in Blender in Pose mode. It's a pretty good way of testing your vertex weights, once we get a feel for the differences between the older Maya bone system vs Blender. In Blender pose mode, the length of a bone is always on the Y axis. I haven't got the formulas in this proof of concept - I think Tom will get to it later after he finishes the blend file plugin.

Column M: Bone offset multipliers. similar to Bone scale multipliers, except move the bone instead of changing its size. In Blender pose mode, swap the X and Y values.

Column N: The mesh morphs (system avatar only) and the skeleton morphs (both system avatar and mesh attachments) often are named differently than the driver or Appearance shape slider name. I left the names here, if different.

Columns O-Q: Slider ranges for individual morph meshes or param_skeleton.

The next three sheets are handy while you're working on vertex weights. Some of the information from the first sheet, resorted by bone name.

XRef by bones: base mesh bones, volume bones, extra bones sorted by bone hierarchy XRef by bones Bento Head: sorted by face part, more or less. XRef by bones Bento Other: hands, critter parts.

Bone hierarchy: a list of all 159 bones in hierarchy order. Easier to see how each bone is parented.

List of Appearance shape sliders

last edited Ada Radius 2023-07-21

AdaRadius commented 1 year ago

Major overhaul based in new information from Tom Ernst.