tm-better-chat icon indicating copy to clipboard operation
tm-better-chat copied to clipboard

Write a Python script to automate emote packing

Open codecat opened this issue 9 months ago • 0 comments

Automate emote packing using a Python script. It would take as an input the following:

{
  "name": "Better Chat Global Emotes",
  "emotes": {
    "Kappa": "https://static-cdn.jtvnw.net/emoticons/v2/25/default/dark/1.0",
    "peepoHey": "https://cdn.7tv.app/emote/60aeec1712d7701491f89cf5/1x.webp",
    "Bedge": "https://cdn.7tv.app/emote/60ae8d9ff39a7552b658b60d/1x.webp"
  }
}

Then, download all emotes in emotes and pack them into a single spritesheet using a rectangle packer algorithm. (Maybe this one?) All emote frame positions and sizes can then be placed in the json definition automatically.

Animated emotes must have all its frames placed in the spritesheet as well, and frame times must be automatically placed in the loading json. We will probably also need some kind of optimization for this, so that we don't fill the spritesheet with 500 identical frames. (Doesn't have to be automatic, we can define this in the json described above as well.)

Note: This is a semi-big project with low priority. This might be suitable for a new repository instead.

codecat avatar Sep 11 '23 13:09 codecat