Rebirth saves flatten animation layers; missing animations show red; pivot paths follow libraries

A Rebirth document's game copy turns each animation layer into plain layers,
one per layer its child draws, baked a frame at a time (runs of identical
frames merged; skew dropped), adding library spritesheets at paths relative to
the document; the editor's copy is unchanged and the Isaac warning says so.
Layers whose animation isn't in its file are drawn red in the Layers window
(nothing is said while a library hasn't loaded). Onionskin pivot paths are
redrawn when a library loads or reloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 18:16:35 -04:00
1 parent 76c2186c81
commit 8807096170
16 files changed
+278 -21

No files matched your search

+1 -1
View File
@@ -749,7 +749,7 @@ namespace anm2ed::imgui
if (settings.onionskinIsEnabled && settings.onionskinIsPivotPath && !isIsolated)
{
auto key = std::tuple{document.hash, reference.animationIndex, isRootTransform};
auto key = std::tuple{document.hash, document.librariesRevision, reference.animationIndex, isRootTransform};
if (key != pivotPathsKey || pivotPaths.empty())
{
pivotPathsKey = key;
+1 -1
View File
@@ -34,7 +34,7 @@ namespace anm2ed::imgui
std::vector<glm::vec2> points{};
};
std::vector<PivotPath> pivotPaths{};
std::tuple<std::uint64_t, int, bool> pivotPathsKey{};
std::tuple<std::uint64_t, std::uint64_t, int, bool> pivotPathsKey{};
void recording_start(Manager&, Settings&, Document&, const model::Animation*);
void recording_stop(Manager&, Document&);
+16 -11
View File
@@ -167,17 +167,22 @@ namespace anm2ed::imgui
track_items_actions_add<model::Layer>(actions, panel, SelectionKind::LAYERS, ElementType::LAYER_ELEMENT,
TOOLTIP_ADD_LAYER, TOOLTIP_REMOVE_UNUSED_LAYERS, EDIT_REMOVE_UNUSED_LAYERS,
EDIT_PASTE_LAYERS, TOAST_DESERIALIZE_LAYERS_FAILED, layers_get);
ListRows rows{
.label_get = [&](int id) { return layer_label_get(*model::item_get(layers, id)); },
.tooltip_draw =
[&](int id)
{
auto layer = model::item_get(layers, id);
item_tooltip_draw(resources, layer->name, id);
ImGui::TextUnformatted(
std::vformat(localize.get(FORMAT_SPRITESHEET_ID), std::make_format_args(layer->spritesheetId)).c_str());
},
.activate = [&](int id) { manager.item_properties_open(ElementType::LAYER_ELEMENT, id); }};
ListRows rows{.label_get = [&](int id) { return layer_label_get(*model::item_get(layers, id)); },
.is_invalid = [&](int id)
{ return document.is_layer_animation_missing(*model::item_get(layers, id)); },
.tooltip_draw =
[&](int id)
{
auto layer = model::item_get(layers, id);
item_tooltip_draw(resources, layer->name, id);
if (document.is_layer_animation_missing(*layer))
ImGui::TextUnformatted(localize.get(TOOLTIP_LAYER_ANIMATION_MISSING));
else if (!layer->is_animation())
ImGui::TextUnformatted(std::vformat(localize.get(FORMAT_SPRITESHEET_ID),
std::make_format_args(layer->spritesheetId))
.c_str());
},
.activate = [&](int id) { manager.item_properties_open(ElementType::LAYER_ELEMENT, id); }};
list_panel_draw(panel, actions, {{ACTION_ADD, ACTION_REMOVE_UNUSED}},
[&]() { content_list_draw(panel, SelectionKind::LAYERS, item_ids_get(layers), rows); });
}
+3
View File
@@ -122,9 +122,11 @@ namespace anm2ed::imgui
auto font = rows.font_get ? rows.font_get(key) : isFocused ? font::ITALICS : font::REGULAR;
auto label = rows.label_get(key);
auto isInvalid = rows.is_invalid && rows.is_invalid(key);
ImGui::PushID(key);
ImGui::SetNextItemSelectionUserData(index);
if (font != font::REGULAR) ImGui::PushFont(panel.resources.fonts[font].get(), font::SIZE);
if (isInvalid) ImGui::PushStyleColor(ImGuiCol_Text, CARD_TINT_INVALID);
if (arrowKey == key) ImGui::SetKeyboardFocusHere();
bool isActivated{};
@@ -157,6 +159,7 @@ namespace anm2ed::imgui
if (isActivated || ImGui::IsItemClicked(ImGuiMouseButton_Left) || ImGui::IsItemClicked(ImGuiMouseButton_Right))
row_select(selection, focus, rows, key);
if (isInvalid) ImGui::PopStyleColor();
if (font != font::REGULAR) ImGui::PopFont();
row_scroll_update(state, key, arrowKey);
if (state.newId == key) state.newId = -1;
+1
View File
@@ -72,6 +72,7 @@ namespace anm2ed::imgui
std::function<std::string(int)> name_get{};
std::function<void(int, const std::string&)> rename{};
std::function<bool(int)> is_locked{};
std::function<bool(int)> is_invalid{};
std::function<resource::font::Type(int)> font_get{};
std::function<void(int)> tooltip_draw{};
std::function<CardImage(int)> image_get{};