CAVtemplate file Structure
Header
The template file always begins with a header defining the version number of the CAVtemplates configuration file.
Example:
<?xml version="1.0"?>
<!-- CAVtemplate version# - keep this around -->
<CAVtemplate version="1">
NOTE - Any line which begins with "<!" is a comment header and does not affect the function of the CAV system, but is used to help navigate the file in an XML veiwer.
Hierarchy
The CAVtemplates.xml file defines individual avatar option sets within the following hierarchial structure:
Race»Gender»Avatar
Avatar must be defined inside of a Gender which must be defined inside of a Race. Individual avatar definisions, including all its parts, textures and sequences are always defined at the "Avatar" level. The higher levels are simply used to provide structure to the CAV Builder window in the browser.
Example:
<!-- Comment heading telling me that human avatars go here-->
<race name="Human">
<gender name="Female">
<avatar name="none">
**AVATAR DEFINITIONS GO HERE**
</avatar>
</gender>
<gender name="Male">
<avatar name="none">
**AVATAR DEFINITIONS GO HERE**
</avatar>
</gender>
</race>
Notice that a </> type definition must occur at the end of each catagory type, so <gender> is ended by </gender> and so forth. All avatars must be inside of a gender, and all genders must be inside of a race.
File footer
The template file finishes with the followind footer:
<!-- End of all cav templates in the list -->
</CAVtemplate>
Again, the comment is for reference only.
3.1 Avatar Definitions
Each avatar has three basic definitions which control how it may be built:
Geometry - Avatar "parts". These are the 3D models that the avatar is constructed out of.
Texture Layers - The "paint" that define the look of the avatar pieces. Soime of these can be selected and some are forced (e.g. the skin tone)
Sequences -
Definitions need not be defined in this order. For example, sequences may be defined before textures or any other order.
Geometry
Avatars can be constructed out of an arbitrary number of parts, as defined with the <bodypart> template entry. The user will be presented with a list of selectable geometries (parts) for each catagory that is defined. Only one geometry can be selected for each catagory, so if two parts are intended to be worn at the same time, then the parts need to be defined in two seperate catagories. Geometry is defined with the definition.
bodypart definition:
The <bodypart> definition creates a new geometry category, with a list of selectable geometries that the user can choose from. Individual geometries are defined with <geometry>, inside the curent <bodypart> definition.
Options:
name="MenuNameHere" - The name option defines the name of the current bodypart list as it will apear to the user in the CAV builder window in the browser. This should be a descriptive name so that the user understands what part is being modified, such as "Upperbody", "Torso", or "Legs". Thi swill vary depending on how the avatar parts are constructed.
force="yes/no" - Must be "yes" or "no". If yes, then this geometry part MUST be worn by the CAV. If this is "no" then this part may remain unselected. This option is ideal for making sure that critical body parts are selected, for instance; If the user's head was not forced to be selected, that person could build a headless avatar. If a bodypart is forced, then the first part in the list will be the default.
Geometry definition:
The <geometry> definition references individual parts that a user is allowed to select from in the current bodypart list.
Options:
name="PartNameHere" - The name option defines the name of the part as it will apear to the user in the dropdown list for the current part type. This should generally be a descriptive name like "Red Baseball Cap" so that the user knows what he is selecting.
file="FileName.x" - The file option defines the actual filename of the bodypart that is used by the current geometry definition. The CAV builder currently must use Directx .x files, in binary or ASCII format.
Example:
<bodypart name="Head" force="yes">
<geometry name="Head1" file="part_head1.x"/>
<geometry name="Head2" file="part_head2.x"/>
</bodypart>
<bodypart name="Body" force="yes">
<geometry name="Body1" file="part_body1.x"/>
<geometry name="Body2" file="part_body2.x"/>
</bodypart>
<bodypart name="Hat" force="no">
<geometry name="Hat1" file="part_Hat1.x"/>
<geometry name="Hat2" file="part_Hat2.x"/>
</bodypart>
Notice that the head and body are forced, but the hat is not. This CAV can be built with no hat, but not without a head. Since head and body are forced catagories, head1 and body1 will be worn by default, since the user cannot deselect these parts.
Texture Layers
By default all geometry will use the texture(s) that are called in the file itself, just as any other object in the Activeworlds environment. Thus it is possible to have no texture definitions in the template file at all. However, in order to add layers to a texture, or to modify its color or opacity, then a texture definition must be added to the template file eith the definition.
Texturelayer definition:
The <texturelayer> definition will add a new modifyable texture stack to the CAV. This stack will replace an existing texture that is already called by a geometry file with the results of the current stack. The stack behaves differently depending on the options applied to the <texturelayer> definition. Individual layers in the stack are defined with the <texture> definition.
<texturelayer> options:
name="LayerName" - tex="ReplaceString" - The tex option defines the name of the geometry texture to be replaced by the currrent stack. This will replace any texture that contains the enclosed character string anywhere in the filename. Therefore a bodypart that calls the texture myfacefile.jpg will be replaced by the results of a stack which defines tex as either "my", "face", or "myfacefile".
Be aware that the results of the current stack will replace every file which conatains the defined string, therefore care must be taken to be specific enough to cover all of the texures that are intended to be replaced and no others.
sel="yes/no" - The sel option defines wether the current stack is selectable by the user or not, and must be either "yes" or "no". The sel option also drastically changes the behavior of the stack based on wether "yes" or "no" is defined. "Yes" is the default and if sel is not defined then the layer is assumed to be selectable.
If "no" is defined, then the current stack will be compiled into one resulting image which will replace the image defined by the "tex" option. All of the color modifier options defined in a non-selectable texture stack are presented to the user in the "Base Color" sub-heading of the CAV builder window.
This option is ideal to define a base textures that can be "stacked upon" by other texture layers. For example a base skin texture for the body can be defined which allows colorization and modification and which will allow a later selectable stack to apply clothing layers on top of it.
If "yes" is defined, then the current stack behaves as a list of texture layers from which a user may choose one to be applied on top of a previously defined non-selectable layer. Only one texture in a selectable stack may be selected at a time, so textures that should exist together should be in seperate selectable texture stacks. For instance, on a normal avatar, there should be a seperate selectable stack for "Pants", "Shirts", etc, so that each can be applied to the base layer in turn.
stack="number" - The stack option defines in which order each stack is applied in and is only used by selectable stacks where sel="yes". This must be a number value and be applied in sequencial order in the template file.
<texture> definition:
The <texture> definition adds a new modifyable texture layer to the current stack, and is defined from within the current <texlayer>.
<texture> options:
file="ImageFilename.png" - The file option defines the file name of the image used in this texture.
name="LayerName" - The name option defines the name that is seen by the user in the CAV builder window for this texture.
opt="ColorOption" - The opt option defines what colorization and modification options are availible to the user for the current texture. This is not a required option and may be left out. The following options are availible:
"skin_color" - Skin_color is a special color option that forces the user to select a color from a predetermined color palette, as defined by an image file located in the browser client folder Default>Textures this file must be called skinmap.bmp. It must be in the .bmp format. This color picker is presented to the user near the top of the CAV bulder window.
"color" - This option allows the user to select a color with an RGB color picker that is presented to the user under the current texturelayer dropdown menu in the CAV builder window.
"alpha_color" - This option is the same as "color", but also allows the user to set the alpha, or transparency of the current texture with a slider, shown next to the color picker box.
In all cases the selected color option is multiplied by the current texture. Therefore, greyscale textures work best with a color options, as textures which already have colors in them tend to result in unexpected colors.
Texure layer example:
<texlayer tex="face" sel="no">
<texture file="face_greyscale.png" opt="skin_color"/>
<texture file="face_lips.png" name="Lips" opt="alpha_color"/>
<texture file="avf_face_iris.png" name="EyeColor" opt="color"/>
<texture file="avf_face_eyeliner.png" name="Eyeliner" opt="alpha_color"/>
</texlayer>
<texlayer tex="body" sel="no">
<texture file="body_greeyscale.png" opt="skin_color"/>
<texture file="body_highlight.png"/>
<texture file="body_nails.png" name="Fingernails" opt="color"/>
</texlayer>
<texlayer name="Pants" tex="body" stack="1">
<texture name="Jeans" file="body_jeans.png"/>
<texture name="Shorts" file="body_shorts.png" opt="color"/>
</texlayer>
<texlayer name="Shirt layer 1" tex="body" stack="2">
<texture name="Blouse" file="shirt_blouse.png" opt="alpha_color"/>
<texture name="Sweater" file="shirt_sweater.png"/>
<texture name="TankTop" file="shirt_tank.png" opt="alpha_color"/>
</texlayer>
<texlayer name="Shirt layer 2" tex="body" stack="3">
<texture name="Blouse" file="shirt_blouse.png" opt="alpha_color"/>
<texture name="Sweater" file="shirt_sweater.png"/>
<texture name="TankTop" file="shirt_tank.png" opt="alpha_color"/>
</texlayer>
Notice that the first two stacks are non-selectable, since sel is set to "no". These layers will be combined together to form one base texture which can be built upon. The second two stacks are selectable, since they do not have the sel="no" option defined ("yes" is default). The "pants" and "shirts" are in seperate layer stacks so they can both be worn together. Only one from each list may be applied. Also, notice that the same files are called in both Shirt layers, so that they can be layered over each other.
Sequences
Avatar animation sequences are define under the <seqs> section of the template file with the following sub-headings: There are two types of animation sequences or "gestuires"; implicit and explicit, as well as a section of options. Each sunheading must be written in brackets.
[implicit] - Implicit animations are invoked when the user performs certain actions, or certain conditions are present. Implicit animations are defined as follows:
ImplicitAnimation=animation_filename
The following implicit animations exist:
walk - Invoked when the user walks
run - Invoked when the user runs
wait - Invoked when the user stops moving
endwait - Invoked at the end of the wait animation
swim - Invoked when the user moves in water
float - Invoked when the user is motionless in water
fly - Invoked when the user moves in the air
hover - Invoked when the user is motionless in the air
jump - Invoked when the user presses the jump key
fall - Invoked when the user falls
idle - Invoked when the user does not press a key for an extended time
[explicit] - Explicit gestures are invoked by the user, and are selected from the "Gestures" toolbar in the browser. Explicit gestures are defined as follows:
gesture1=DisplayName, FileName, where the number after "gesture" is sequencially incremented for each new gesture. DisplayName is the name the user want the gesture to apear as in the gestures toolbar, and FileName is the name of the animation file in the designated Seqs content folder.
A special gesture definition can be used to gather the gestures into groups, as follows:
gesture1=group, GroupName, where GroupName is the name the user wants this group to be seen as in the gestures toolbar. All numbered gestures after a group is defined are included in that group, until a new group is defined.
[options]
The following optiones are defined as follows:
option=number, where number is either 1 (on) or 0 (off)
autowalk - Allows the avatar walk sequence to be sped up or slowed down automatically with the speed of the avatar
autolook - Turns the avatar's head and upper body to turn when the users camera turns, simulating the avatar "looking around"
Animation definition example:
<seqs>
[options]
autowalk=1
autolook=1
[implicit]
walk=explain
run=run_filename
wait=explain
endwait=explain
swim=swim_filename
float=float_filename
fly=fly_filename
hover=hover_filename
jump=jump_filename
fall=fall_filename
idle=idle_filename
[explicit]
gesture1=group,Emotions
gesture2=Cry,cry_animation
gesture3=Happy,happy_animation
gesture4=group,Dances
gesture5=ChickenDance,chkdance_animation
gesture6=Salsa,salsa_animation
</seqs>
|