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

+4 -3
View File
@@ -309,7 +309,7 @@ namespace anm2ed::render
glm::vec4 animation_bounds_get(const Document& document, const model::Animation& animation, bool isRootTransform)
{
auto bounds = model::animation_rect(document.model, animation, isRootTransform);
auto bounds = model::animation_rect(document.model, animation, isRootTransform, document.library_resolver_get());
return bounds != glm::vec4(-1.0f) ? bounds : BOUNDS_DEFAULT;
}
@@ -325,8 +325,9 @@ namespace anm2ed::render
canvas.viewport_set();
canvas.clear(glm::vec4(glm::vec3(background) * background.a, background.a));
canvas.layers_render(
shader, document.model, animation, {.time = time, .isRootTransform = isRootTransform},
canvas.transform_get(zoom, pan), [&](int id) { return document.texture_get(id); },
shader, document.model, animation,
{.time = time, .isRootTransform = isRootTransform, .library_get = document.library_resolver_get()},
canvas.transform_get(zoom, pan), [&](const model::Draw& draw) { return document.draw_image_get(draw); },
[&](int id) { return document.shader_get(id); });
auto pixels = canvas.pixels_get();
canvas.unbind();