lol-anm-parser

A parser for .anm files from League of Legends.

Usage no npm install needed!

<script type="module">
  import lolAnmParser from 'https://cdn.skypack.dev/lol-anm-parser';
</script>

README

lol-anm-parser

A parser for .anm files from League of Legends.

Download

lol-anm-parser is installable via:

  • GitHub git clone https://github.com/Pupix/lol-anm-parser.git
  • npm: npm install lol-anm-parser

Usage example

var AnmParser = require('lol-anm-parser'),
    anm = new AnmParser();
    
    anm.read('Lamb_Idle.anm', function (err, data) {
        console.log(data);
        //  {
        //      duration: 10.066666666666666
        //      FPS: 30
        //      bones: [
        //          {
        //              hash: 497252,
        //              frames: [
        //                  {
        //                      position: {...}
        //                      quaternion: {...}
        //                      scale: {...}
        //                  }
        //              ]
        //              ...
        //          }
        //          ...
        //      ]
        //  }
    });

Available methods

N.B: All methods act as promises if no callback is passed.

parse(path, cb)

It will roughly parse a .anm file from the given path.

Parameters

  1. path {string} A path to where the file to parse resides.
  2. [cb] {Function} A callback called with (error, parsedData) as arguments.

read(path, cb)

It will read a .anm file from the given path, creating missing data or removing irrelevant data from the animation file.

Parameters

  1. path {string} A path to where the file to read resides.
  2. [cb] {Function} A callback called with (error, readData) as arguments.