Difference between revisions of "Mesh/Avatar Shape XML Format"
m |
m |
||
Line 49: | Line 49: | ||
== Comments == | == Comments == | ||
Comments are styled in the standard HTML style, with the string | Comments are styled in the standard HTML style, with the string <html4strict><!--</html4strict> denoting the start of a comment, and <html4strict>--></html4strict> denoting the end of a comment. This is per the XML specification. | ||
*Example: <!-- wearable: shape --> | *Example: <html4strict><!-- wearable: shape --></html4strict> | ||
== File Termination == | == File Termination == |
Revision as of 11:17, 27 November 2012
History
The Shape XML format has been ingrained in the viewer since the early days, long before mesh existed. However, with the addition of rigged mesh and customized clothing, the file has become invaluable to creators. Sometimes called an "archetype file" due to it's default name "new_archetype.xml".
Header
The file is standard XML, with 3 parameters:
- <?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
- The 'version' parameter sets the version of the XML markup. (should always be 1.0)
- The 'encoding' parameter sets the character encoding for the file. (should always be US-ASCII)
- The 'standaline' parameter informs that the file is self-containted, and not dependent on any external files. (should always be yes)
(note that some viewers set standalone="true". This is technically incorrect via the XML standard. It should be "yes")
Root Node
The root node is of type 'linden_genepool' witih 1 parameter:
- <linden_genepool version="1.0">
- The 'version' parameter sets the version of the data contained in the node. Currently LL's data is version 1.0. Future revisions may increment this version, so any implementation should check this version number before using the data.
Data Body
The Root node contains one node of type 'archetype' with one parameter.
- <archetype name="???">
- The 'name' parameter is a information parameter, and can contain anything, or nothing. Most commonly populated with 3 question marks.
The Data
The data inside is a list of parameters and textures associated with the Avatar's appearance. These can be broken up into 4 categories:
- Shape
- Skin
- Hair
- Eyes
Each category will have several "param" nodes and possibly "texture" nodes included. More about these nodes in the next section.
Param Nodes
"param" nodes correspond to sliders in the appearance pane. Each has 3 parameters:
- Example: <param id="649" name="torso muscles" value="0.500"/>
- The 'id' parameter corresponds to an internal viewer table of possible sliders. These numbers are guaranteed to be unique, and always correspond to the same slider.
- The 'name' parameter corresponds to internal 'driving elements' in the viewer. This can vary depending on the type of param. For shapes, it's often the name of the morph being controlled. For skins or eyes, it's usually a material that's being changed (color etc). For hair, a combination of both are present. These are *not* always unique. For example, there are two parameters called "torso muscles", with different IDs (one for male, one for female).
- The 'value' parameter is the value of the slider. It is however in the internally used format, not the 0-100 value seen by Residents. Calculating what these values mean requires finding the Minimum and Maximum of that value from other sources, such as the Linden Avatar Definition File (avatar_lad.xml)
Texture Nodes
"texture" nodes correspond to textures applied via the appearance pane. Each has 2 parameters:
- Example: <texture te="3" uuid="00000000-0000-0000-0000-000000000000"/>
- The 'te' parameter corresponds to an internal viewer table of possible textures. These numbers are guaranteed to be unique.
- The 'uuid' parameter corresponds to the UUID of the texture applied at the time of the XML creation.
Note that 'texture' nodes are optional and not guaranteed to be present. Especially when the file is generated from 3rd party sources.
Comments
Comments are styled in the standard HTML style, with the string <html4strict></html4strict> denoting the end of a comment. This is per the XML specification.
- Example: <html4strict></html4strict>
File Termination
The file is terminated by the closing of the 'archetype' and 'linden_genepool' nodes:
- </archetype></linden_genepool>