How find atlas animation geometry-data?

Atlas animations are good way to organize your atlas. But, afaik, if you put your images into animation you can’t access to images geometry data (uvs, vertices, indices, width, height…)

I can loop through images like this:

local image_num
for i, animation in ipairs(atlas_data.animations) do
    if animation.id == image_id then
        image_num = animation.frame_start
        break
    end
end

it will give output like this:

{ --[[0x7e122c023ef0]]
  fps = 30,
  frame_start = 11,
  frame_end = 12,
  playback = 0,
  id = "header",
  flip_vertical = false,
  width = 16,
  flip_horizontal = false,
  height = 17
}
DEBUG:SCRIPT: 50,
{ --[[0x7e122c0243f0]]
  fps = 30,
  frame_start = 7,
  frame_end = 8,
  playback = 0,
  id = "button_g",
  flip_vertical = false,
  width = 16,
  flip_horizontal = false,
  height = 18
}
DEBUG:SCRIPT: 51,
{ --[[0x7e122c0248f0]]
  fps = 8,
  frame_start = 45,
  frame_end = 47,
  playback = 4,
  id = "pointer",
  flip_vertical = false,
  width = 36,
  flip_horizontal = false,
  height = 18
}
DEBUG:SCRIPT: 52,
{ --[[0x7e122c024df0]]
  fps = 30,
  frame_start = 50,
  frame_end = 197,
  playback = 4,
  id = "tileset",
  flip_vertical = false,
  width = 32,
  flip_horizontal = false,
  height = 48
}

But there is completely diffrent image data at range 50 and 197, is there the way to find correct data?

1 Like

If you pprint(atlas_data), you’ll see the full structure of the atlas.
The fields are described here: API reference (Resource)

I replied in the created issue with an example and explanation. @boruok I do not see any data missing and it is perfectly possible to get uvs of each frame of an animation.

2 Likes