Libraries window, animation layers and child playback

A Libraries window (docked with Spritesheets and Sounds) links other .anm2
files: cards list each one's animations, open it as a tab, and reload when
it changes on disk. A layer's Source is a spritesheet or an animation, from
this file or a library; the preview, renders and CLI draw the child in the
layer's frame. Animation-layer keyframes set the child's animation, mode
(loop, once, hold), start frame (or random) and restart; Child is also a
copyable frame property. All of it is editor-only and counted by the Isaac
warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 16:51:48 -04:00
1 parent 6edf5f0e5b
commit d1a6d89d14
44 files changed
+873 -81

No files matched your search

+3 -4
View File
@@ -271,18 +271,17 @@ namespace anm2ed
rect_end(rectVAO, mode, count);
}
// An animation's layers alone (no markers or helpers); spritesheet images and custom shaders are looked up by id.
// An animation's layers alone (no markers or helpers); spritesheet images are looked up by draw, custom shaders by id.
void Canvas::layers_render(Shader& shader, const model::Model& model, const model::Animation& animation,
const model::DrawOptions& options, const mat4& transform,
const std::function<const Image*(int)>& image_get,
const std::function<const Image*(const model::Draw&)>& image_get,
const std::function<Shader*(int)>& shader_get) const
{
for (const auto& draw : model::animation_draws_get(model, animation, options))
{
if (draw.type != model::DrawType::LAYER) continue;
auto& frame = draw.frame;
auto layer = model::item_get(model.content.layers, draw.id);
auto image = layer ? image_get(layer->spritesheetId) : nullptr;
auto image = image_get(draw);
if (!image || !image->is_valid() || frame.size == vec2()) continue;
auto imageSize = vec2(image->size);
auto uvVertices = math::uv_vertices_get(frame.crop / imageSize, (frame.crop + frame.size) / imageSize);