Frame Blur (Flash's blur filter), child properties in Change All Frame Properties, flips under Visible

Blur is a layer frame's box blur, as Flash's low-quality BlurFilter: a box that many canvas pixels wide, averaged
over the frame's crop (premultiplied) by the texture shader, the quad grown by its reach. An animation layer blurs
its child's draws at least as much. It interpolates, copies, batches (clamped to 0-255), saves as an editor-only
Blur attribute and counts as an Isaac issue.

Change All Frame Properties gains the Child section (animation, mode, start frame, random, restart), applied only
to animation layers and disabled when no animation layer is targeted. Frame Properties' Flip X/Y sit below Visible
instead of inside Child.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 17:16:49 -04:00
1 parent 6b6cd671f7
commit 0adb0f89bc
26 files changed
+308 -48

No files matched your search

+19
View File
@@ -58,6 +58,25 @@ TEST_CASE("a layer frame's depth moves it among the layers for that frame only")
CHECK(model::isaac_issues_get(anm2).depthFrames == 1);
}
TEST_CASE("a layer frame's blur reaches its child's draws and stays out of the game's copy")
{
auto anm2 = model_load(file_load(TEST_DIR / "render" / "nested.anm2"));
anm2.frame_edit({0, LAYER, 1, 0})->blur = 6.0f;
bool isAnyChild{};
for (const auto& draw : model::animation_draws_get(anm2, *anm2.animation_get(0), {}))
if (draw.type == model::DrawType::LAYER && draw.id == 1)
{
isAnyChild = true;
CHECK(draw.frame.blur >= 6.0f);
}
CHECK(isAnyChild);
auto text = model::model_to_string(anm2);
CHECK(game_document_get(text).find("Blur") == std::string::npos);
CHECK(model_load(text).frame_get({0, LAYER, 1, 0})->blur == 6.0f);
CHECK(model::isaac_issues_get(anm2).blurFrames == 1);
}
TEST_CASE("an animation layer draws its child animation, from this file or a library")
{
auto anm2 = model_load(file_load(TEST_DIR / "render" / "nested.anm2"));
+24
View File
@@ -380,6 +380,30 @@ TEST_CASE("change all frame properties changes layer depth only")
CHECK(model.frame_get(null)->depth == 0);
}
TEST_CASE("change all frame properties blurs layers and changes only animation layers' children")
{
auto model = model_load(file_load(TEST_DIR / "render" / "nested.anm2"));
Reference animationLayer{0, LAYER, 1, 0};
Reference spritesheetLayer{1, LAYER, 2, 0};
REQUIRE(model.frame_get(spritesheetLayer));
edit::frames_change_apply(model, {.references = {animationLayer, spritesheetLayer}},
{.blur = 8.0f, .childAnimation = "Spin", .childMode = ChildMode::ONCE, .childStart = 3},
ChangeType::ADJUST);
auto child = *model.frame_get(animationLayer);
CHECK(child.blur == 8.0f);
CHECK(child.childAnimation == "Spin");
CHECK(child.childMode == ChildMode::ONCE);
CHECK(child.childStart == 3);
auto sprite = *model.frame_get(spritesheetLayer);
CHECK(sprite.blur == 8.0f);
CHECK(sprite.childAnimation.empty());
CHECK(sprite.childMode == ChildMode::LOOP);
CHECK(sprite.childStart == 0);
edit::frames_change_apply(model, {.references = {animationLayer}}, {.blur = 1000.0f}, ChangeType::ADD);
CHECK(model.frame_get(animationLayer)->blur == FRAME_BLUR_MAX);
}
TEST_CASE("animations_merge moves triggers past the animation placed before them")
{
auto model_make = []()
+24
View File
@@ -157,3 +157,27 @@ TEST_CASE("animation layers draw their child animations")
pixels.data()));
golden_image_check("nested_frame_0.png");
}
TEST_CASE("a blurred layer spreads past its crop like Flash's blur filter")
{
RenderFixture fixture("spin.anm2");
if (!fixture.gl.is_valid())
{
MESSAGE("skipped: no OpenGL context");
return;
}
REQUIRE(fixture.document->is_valid());
// The red square (16 x 16 at (-16, 0)) sharp leaves the canvas clear 2 above its top edge and solid 1 inside it; an
// 8 pixel box spreads a third of it out and takes as much from inside.
constexpr glm::vec2 OUTSIDE{-20.0f, -10.0f}, INSIDE{-20.0f, -7.0f};
auto sharp = fixture.frame_get(0.0f);
fixture.document->model.frame_edit({0, LAYER, 0, 0})->blur = 8.0f;
fixture.animation = fixture.document->model.animation_get(0);
auto blurred = fixture.frame_get(0.0f);
CHECK(fixture.pixel_get(blurred, OUTSIDE).r > fixture.pixel_get(sharp, OUTSIDE).r + 40);
CHECK(fixture.pixel_get(blurred, INSIDE).r + 40 < fixture.pixel_get(sharp, INSIDE).r);
REQUIRE(resource::Image::write_pixels_png(OUTPUT_DIR / "spin_blur_frame_0.png", glm::ivec2(fixture.canvas->size),
blurred.data()));
}