Skip to content

Preserve z-index ordering in animation groups - #4918

Merged
behackl merged 1 commit into
ManimCommunity:mainfrom
behackl:agent/fix-animation-group-z-index-ordering
Aug 9, 2026
Merged

Preserve z-index ordering in animation groups#4918
behackl merged 1 commit into
ManimCommunity:mainfrom
behackl:agent/fix-animation-group-z-index-ordering

Conversation

@behackl

@behackl behackl commented Aug 8, 2026

Copy link
Copy Markdown
Member

Fixes #4834.

Animation groups recursively collected only their nested animation mobjects when determining the static frame cache boundary. This could leave a higher-z mobject in the static frame while an introduced lower-z mobject was rendered on top of it.

Keep the composition wrapper family in the moving set alongside nested animation families, and add a regression test for Succession with ShowPassingFlash.

Tests:

  • pre-commit run --files manim/scene/scene.py tests/module/scene/test_scene.py
  • pytest -q tests/module/scene/test_scene.py tests/module/animation/test_composition.py
  • pytest -q tests/test_graphical_units/test_geometry.py -k 'negative_z_index_AnimationGroup or negative_z_index_LaggedStart or nested_animation_groups_with_negative_z_index'

Opened via Codex using GPT-5.6 Sol.

@behackl behackl left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and now also checked manually. I think this is okay and ready to be reviewed. 👍

@behackl
behackl marked this pull request as ready for review August 8, 2026 10:28
@behackl behackl added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Aug 9, 2026
@behackl
behackl merged commit acd1e23 into ManimCommunity:main Aug 9, 2026
17 checks passed
@behackl
behackl deleted the agent/fix-animation-group-z-index-ordering branch August 9, 2026 21:49
@behackl behackl changed the title fix(scene): preserve z-index ordering in animation groups Preserve z-index ordering in animation groups Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set_z_index works well, until animating other Mobjects in scene

1 participant