Layer frame depth: change a layer's draw order for part of an animation

Layer frames get an editor-only Depth (Frame Properties, property
copy/paste): +N draws that layer N layers above its place in the timeline
for that frame, -N below; stepped, not interpolated. The draw list orders
layers by it (preview, renders, CLI). Saved as Depth in the editor's copy
only; the Isaac Compatibility Warning and anm2ed info count frames using it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-06 01:21:50 -04:00
1 parent 94d0bbf206
commit f3fb7d5101
13 files changed
+78 -6

No files matched your search

+22
View File
@@ -35,3 +35,25 @@ TEST_CASE("root transforms fold into layer draws")
isAnyMoved |= plain[i].type == model::DrawType::LAYER && plain[i].parent != rooted[i].parent;
CHECK(isAnyMoved);
}
TEST_CASE("a layer frame's depth moves it among the layers for that frame only")
{
auto anm2 = model_load(file_load(TEST_DIR / "render" / "spin.anm2"));
auto layer_ids_get = [&](float time)
{
std::vector<int> ids{};
for (const auto& draw : model::animation_draws_get(anm2, *anm2.animation_get(0), {.time = time}))
if (draw.type == model::DrawType::LAYER) ids.push_back(draw.id);
return ids;
};
CHECK(layer_ids_get(0.0f) == std::vector{1, 0});
anm2.frame_edit({0, LAYER, 0, 0})->depth = -1;
CHECK(layer_ids_get(0.0f) == std::vector{0, 1});
CHECK(layer_ids_get(5.0f) == std::vector{1, 0});
auto text = model::model_to_string(anm2);
CHECK(game_document_get(text).find("Depth") == std::string::npos);
CHECK(model_load(text).frame_get({0, LAYER, 0, 0})->depth == -1);
CHECK(model::isaac_issues_get(anm2).depthFrames == 1);
}