Skip to content

Commit

Permalink
fix(lib): pass skip argument to ManimCE (#524)
Browse files Browse the repository at this point in the history
* fix(lib): pass skip argument to ManimCE

* fix(lint): make ruff happy
  • Loading branch information
jeertmans authored Jan 22, 2025
1 parent 941b895 commit dbced6e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(unreleased)=
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.4.1...HEAD)

(unreleased-fixed)=
### Fixed

- Fixed `start_skip_animations` to actually pass argument to ManimCE,
otherwise video animations were still rendered, just excluded from
the final output.
[#524](https://github.com/jeertmans/manim-slides/pull/524)

(v5.4.1)=
## [v5.4.1](https://github.com/jeertmans/manim-slides/compare/v5.4.0...v5.4.1)

Expand Down
4 changes: 1 addition & 3 deletions manim_slides/slide/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,7 @@ def start_skip_animations(self) -> None:
self._skip_animations = True

def stop_skip_animations(self) -> None:
"""
Stop skipping animations.
"""
"""Stop skipping animations."""
self._skip_animations = False

def wipe(
Expand Down
5 changes: 4 additions & 1 deletion manim_slides/slide/manim.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def next_slide(
**kwargs: Any,
) -> None:
Scene.next_section(
self, *args, skip_animations=base_slide_config.skip_animations, **kwargs
self,
*args,
skip_animations=base_slide_config.skip_animations | self._skip_animations,
**kwargs,
)
BaseSlide.next_slide.__wrapped__(
self,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_base_slide.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ def test_wait_time_between_slides(self, base_slide: BaseSlide) -> None:
assert base_slide.wait_time_between_slides == 0.0

def test_skip_animations(self, base_slide: BaseSlide) -> None:
assert base_slide._skip_animations == False
assert not base_slide._skip_animations

def test_start_and_stop_skip_animations(self, base_slide: BaseSlide) -> None:
base_slide.start_skip_animations()
assert base_slide._skip_animations == True
assert base_slide._skip_animations
base_slide.stop_skip_animations()
assert base_slide._skip_animations == False
assert not base_slide._skip_animations

def test_play(self) -> None:
pass # This method should be tested in test_slide.py
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbced6e

Please sign in to comment.