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
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
#include "model.hpp"
|
||||
@@ -22,16 +23,22 @@ namespace anm2ed::model
|
||||
int indexOffset{};
|
||||
};
|
||||
|
||||
// The document a library id of a document (the one drawn, or a library) points at; nullptr when not loaded.
|
||||
using LibraryGet = std::function<const Model*(const Model&, int)>;
|
||||
|
||||
struct DrawOptions
|
||||
{
|
||||
float time{};
|
||||
bool isRootTransform{};
|
||||
bool isIndexSampled{};
|
||||
std::vector<DrawSample> samples{};
|
||||
LibraryGet library_get{};
|
||||
};
|
||||
|
||||
// An item's frame at a time; `parent` is the transform of its root and group root when root transforms are shown
|
||||
// (whose tint and color offset are then folded into a layer's frame). `sample` indexes the samples, -1 for now.
|
||||
// A layer draw shows spritesheet `spritesheetId` of `source`; an animation layer's child animation draws as its
|
||||
// layers' draws, with the animation layer's id and transform.
|
||||
struct Draw
|
||||
{
|
||||
DrawType type{};
|
||||
@@ -41,6 +48,8 @@ namespace anm2ed::model
|
||||
float time{};
|
||||
Frame frame{};
|
||||
glm::mat4 parent{1.0f};
|
||||
const Model* source{};
|
||||
int spritesheetId{-1};
|
||||
};
|
||||
|
||||
glm::mat4 draw_quad_model_get(const Draw&);
|
||||
|
||||
Reference in new issue
Block a user