Part 2 - Animation Basics, tools and ModelDef.XML

Below is a stripped down extract from the ModelDef.Xml file we use. You will notice that some of the content is very similar to what you may have seen in MakeMdl.Parts.Xml but in a more formal XML form and we have added some goodies I will explain later...

ModelDef.XML
   1:  <?xml version="1.0" encoding="utf-8" ?>
   2:  <ModelInfo>
   3:    <Animation name="Ambient" guid="A6F1C5D0-BEF6-449e-BAF8-FB777F27808F" type="Standard" typeParam="AutoPlay,Random" />
   4:    <Animation name="NonRandomAmbient" guid="B03EC8F6-B8D3-4aaf-9F9A-C59FE26608D6" type="Standard" typeParam="AutoPlay" />
   5:    <Animation name="c_tire_blurred_key" guid="4e1cc3e5-5933-445d-80e0-b0dd693125f0" length="100" type="Sim" typeParam2="c_tire_blurred_key" typeParam="AutoPlay" />
   6:    [... more animations go here ...]
   7:       
   8:       <AnimationGroup name="GroupTests" guid="0xB331C7EF,0xE2BA4276,0x84C433B2,0xBA9781B2">
   9:          <AnimationRef guid="40A98760-2FCB-4422-A469-7001DBAAB766"/>
  10:          <AnimationRef guid="23FBBCC2-C861-41b4-90D2-051AC1BCA338"/>
  11:      </AnimationGroup>
  12:   
  13:    <PartInfo>
  14:      <Name>c_tire_blurred_key</Name>
  15:      <Copy>tire_anim</Copy>
  16:      <AnimLength>100</AnimLength>
  17:      <Visibility>
  18:          <Parameter>
  19:              <Sim>
  20:                  <Variable>CENTER WHEEL RPM</Variable>
  21:                  <Bias>-5.0</Bias>
  22:                  <Scale>0.01</Scale>
  23:                  <Units>grads</Units>
  24:              </Sim>
  25:          </Parameter>
  26:      </Visibility>
  27:      <Animation>
  28:          <Parameter>
  29:              <Sim>
  30:                  <Variable>CENTER WHEEL ROTATION ANGLE</Variable>
  31:              </Sim>
  32:          </Parameter>
  33:      </Animation>
  34:    </PartInfo>
  35:   
  36:  </ModelInfo>
  37:   

The file itself starts with a ModelInfo block, which is essentially the root container for all the animation and model related information within the XML file.

The following group of tags (the "Animation" tags) are essentially a decleration of the animations which will be contained in the XML file. These essentially tie actual animations to the apropriate "PartInfo" blocks which are found at the bottom of the sample file. I will go over the details of these and of the parameters for an "Animation" tag in a folloewing post.

The "AnimationGroup" tags are mostly for organization and allows animations to be categorized. This serves no purpose other than to allow some organization within the animation tool.

Speaking of animation tool, we now have a MaxScript based tool which allows for animations to be setup within 3DSMax. Since we are moving away from part name based associations and because we now allow multiple animations per part. We essentially need to know what animations are assigned to a model and where are the keyframes located. All the tool really does is add apropriate tags within Max (as NoteTrack entries) which gives information to our exporter as to which animations are attached to a model. I won't go into too much details about the tool now, i'm sure one of our art bloggers will post more detailed information in regards to how animations are rigged with our new system.