Tuesday, 6 April 2010

XML Scripting

I'd also like to write about the XML scripting that I'm working on, this will be used to script up cut-scenes and maybe even semi-dynamic behaviours. I got my first script working earlier:

<actor>
  <activities>
    <activity id="montage">
        <sequence loop="true">
          <stage overlap="500"><clip name="female/Female1_D6_CartWheel.bvh"        /></stage>
          <stage overlap="500"><clip name="female/Female1_B01_StandToWalk.bvh"     /></stage>
          <stage overlap="500"><clip name="female/Female1_C05_WalkToRun.bvh"       /></stage>
          <stage overlap="500"><clip name="female/Female1_C11_RunTurnLeft90.bvh"   /></stage>
          <stage overlap="500"><clip name="female/Female1_C20_RunToJumpToWalk.bvh" /></stage>
        </sequence>
    </activity>
  </activities>
</actor>

The script simply sequences up a few animations together with a blending overlap of 500ms for all of them, it's fairly self explanatory really. The sequence node is set to loop and since the first stage is given an overlap it will transition back to the start smoothly, making an infinitely long continuous animation.

It certainly makes playing about with animations simpler as I now don't need to wait for the tedious recompile every time I want to fiddle around with numbers.
The script doesn't yet handle every kind of node, in fact it only handles sequence and clip nodes at the moment but the system is in place now and with that exposing new interfaces to the script is relatively easy.

No comments:

Post a Comment