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:
1 parent
76c2186c81
commit
8807096170
16 files changed
+278
-21
No files matched your search
@@ -165,9 +165,17 @@ namespace anm2ed
|
||||
constexpr Flags SERIALIZE_ANM2ED_DEFAULT =
|
||||
SERIALIZE_GROUPS | SERIALIZE_REGIONS | SERIALIZE_SOUNDS | SERIALIZE_NESTED_GROUPS | SERIALIZE_EXTENSIONS;
|
||||
|
||||
namespace model
|
||||
{
|
||||
class Model;
|
||||
}
|
||||
|
||||
// How a document saves: the editor's document alone (extended), or the game's copy with the editor's embedded;
|
||||
// `gameModel` is the game's copy when it differs from the document (animation layers flattened).
|
||||
struct Options
|
||||
{
|
||||
bool isExtendedFormat{};
|
||||
const model::Model* gameModel{};
|
||||
};
|
||||
|
||||
#define FRAME_CHANGE_SCALARS \
|
||||
|
||||
+2
-1
@@ -212,7 +212,8 @@ namespace anm2ed::model
|
||||
}
|
||||
}
|
||||
layerOrders.emplace_back(layerOrder + frame.depth, frame.depth);
|
||||
draws.push_back({type, id, groupType, sample, time, frame, parent, &model, layer ? layer->spritesheetId : -1});
|
||||
draws.push_back(
|
||||
{type, id, groupType, sample, time, frame, parent, &model, layer ? layer->spritesheetId : -1, id});
|
||||
}
|
||||
};
|
||||
if (animation.root.isVisible) track_draws_add(animation.root, DrawType::ROOT, -1, NONE, nullptr);
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace anm2ed::model
|
||||
glm::mat4 parent{1.0f};
|
||||
const Model* source{};
|
||||
int spritesheetId{-1};
|
||||
int sourceId{-1}; // the layer of `source` drawn (a child's, for an animation layer's draws)
|
||||
};
|
||||
|
||||
// A trigger that fires, from the animation played or a child animation (whose ids belong to `source`).
|
||||
|
||||
+1
-1
@@ -1766,7 +1766,7 @@ namespace anm2ed::model
|
||||
{
|
||||
if (options.isExtendedFormat)
|
||||
return model_write(sink, model, SERIALIZE_ANM2ED_DEFAULT | SERIALIZE_EXTENDED_DOCUMENT);
|
||||
model_write(sink, model, SERIALIZE_ISAAC_DEFAULT,
|
||||
model_write(sink, options.gameModel ? *options.gameModel : model, SERIALIZE_ISAAC_DEFAULT,
|
||||
[&]() { model_write(sink, model, SERIALIZE_ANM2ED_DEFAULT, {}, SOURCE_DOCUMENT_TAG); });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user