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:
1 parent
6edf5f0e5b
commit
d1a6d89d14
44 files changed
+873
-81
No files matched your search
@@ -209,7 +209,8 @@ namespace anm2ed::model
|
||||
}
|
||||
|
||||
// Bounds of all visible layer frames over the animation's length, or -1 when nothing is drawn.
|
||||
glm::vec4 animation_rect(const Model& model, const Animation& animation, bool isRootTransform)
|
||||
glm::vec4 animation_rect(const Model& model, const Animation& animation, bool isRootTransform,
|
||||
const LibraryGet& library_get)
|
||||
{
|
||||
constexpr glm::ivec2 CORNERS[4] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
|
||||
glm::vec2 min{std::numeric_limits<float>::infinity()};
|
||||
@@ -217,7 +218,8 @@ namespace anm2ed::model
|
||||
bool isAny{};
|
||||
|
||||
for (float time = 0.0f; time < (float)animation.frameNum; time += 1.0f)
|
||||
for (const auto& draw : animation_draws_get(model, animation, {.time = time, .isRootTransform = isRootTransform}))
|
||||
for (const auto& draw : animation_draws_get(
|
||||
model, animation, {.time = time, .isRootTransform = isRootTransform, .library_get = library_get}))
|
||||
{
|
||||
if (draw.type != DrawType::LAYER || draw.frame.size == glm::vec2()) continue;
|
||||
auto transform = draw.parent * draw_quad_model_get(draw);
|
||||
|
||||
Reference in new issue
Block a user