mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-08-06 14:19:52 +08:00
chore(deps): bump ManimGL to 1.7.1 (#499)
* chore(deps): bump ManimGL to 1.7.1 Bump ManimGL's minimal version, so relax constraints on other deps and remove compatibility issues with Manim * fix(docs): correct PR number * fix(lib): update ManimGL's init See https://github.com/3b1b/manim/issues/2261 * fix(lib): force float * chore(tests): correctly ignore warning * fix(tests) * fix(tests): add skips * chore(fmt): auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(tests) * oops * fix on 3.12 * fix(lib): correctly patch ManimGL * fix(deps): pyrr issue * fix: version --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -10,29 +10,39 @@ from .base import BaseSlide
|
||||
class Slide(BaseSlide, Scene): # type: ignore[misc]
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
kwargs.setdefault("file_writer_config", {}).update(
|
||||
skip_animations=True,
|
||||
break_into_partial_movies=True,
|
||||
write_to_movie=True,
|
||||
)
|
||||
# See: https://github.com/3b1b/manim/issues/2261
|
||||
if kwargs["file_writer_config"].setdefault("output_directory", ".") == "":
|
||||
kwargs["file_writer_config"]["output_directory"] = "."
|
||||
|
||||
kwargs["preview"] = False # Avoid opening a preview window
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def _frame_height(self) -> float:
|
||||
return self.camera.frame.get_height() # type: ignore
|
||||
return float(self.camera.get_frame_height())
|
||||
|
||||
@property
|
||||
def _frame_width(self) -> float:
|
||||
return self.camera.frame.get_width() # type: ignore
|
||||
return float(self.camera.get_frame_width())
|
||||
|
||||
@property
|
||||
def _background_color(self) -> str:
|
||||
return self.camera_config["background_color"].hex # type: ignore
|
||||
rgba = self.camera.background_rgba
|
||||
r = int(255 * rgba[0])
|
||||
g = int(255 * rgba[1])
|
||||
b = int(255 * rgba[2])
|
||||
if rgba[3] == 1.0:
|
||||
return f"#{r:02x}{g:02x}{b:02x}"
|
||||
|
||||
a = int(255 * rgba[3])
|
||||
return f"#{r:02x}{g:02x}{b:02x}{a:02x}"
|
||||
|
||||
@property
|
||||
def _resolution(self) -> tuple[int, int]:
|
||||
return self.camera_config["pixel_width"], self.camera_config["pixel_height"]
|
||||
return self.camera.get_pixel_width(), self.camera.get_pixel_height()
|
||||
|
||||
@property
|
||||
def _partial_movie_files(self) -> list[Path]:
|
||||
|
Reference in New Issue
Block a user