mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-09-19 21:33:29 +08:00
Compare commits
5 Commits
v4.13.2
...
gui-scenes
Author | SHA1 | Date | |
---|---|---|---|
ea2ce6505f | |||
6903919767 | |||
f4971d3a43 | |||
e62a3b05ed | |||
152050612e |
@ -1,5 +1,5 @@
|
||||
[bumpversion]
|
||||
current_version = 4.13.2
|
||||
current_version = 4.13.1
|
||||
commit = True
|
||||
message = chore(version): bump {current_version} to {new_version}
|
||||
|
||||
|
@ -12,7 +12,7 @@ repos:
|
||||
- id: isort
|
||||
name: isort (python)
|
||||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
||||
rev: v2.9.0
|
||||
rev: v2.8.0
|
||||
hooks:
|
||||
- id: pretty-format-yaml
|
||||
args: [--autofix]
|
||||
@ -24,11 +24,11 @@ repos:
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: v0.0.269
|
||||
rev: v0.0.265
|
||||
hooks:
|
||||
- id: ruff
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.3.0
|
||||
rev: v1.2.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
additional_dependencies: [types-requests, types-setuptools]
|
||||
|
@ -66,56 +66,6 @@ Example using 3D camera. As Manim and ManimGL handle 3D differently, definitions
|
||||
:end-before: [manimgl-3d]
|
||||
```
|
||||
|
||||
## Subclass Custom Scenes
|
||||
|
||||
For compatibility reasons, Manim Slides only provides subclasses for
|
||||
`Scene` and `ThreeDScene`.
|
||||
However, subclassing other scene classes is totally possible,
|
||||
and very simple to do actually!
|
||||
|
||||
[For example](https://github.com/jeertmans/manim-slides/discussions/185),
|
||||
you can subclass the `MovingCameraScene` class from `manim`
|
||||
with the following code:
|
||||
|
||||
```{code-block} python
|
||||
:linenos:
|
||||
|
||||
from manim import *
|
||||
from manim_slides import Slide
|
||||
|
||||
|
||||
class MovingCameraSlide(Slide, MovingCameraScene):
|
||||
pass
|
||||
```
|
||||
|
||||
And later use this class anywhere in your code:
|
||||
|
||||
|
||||
```{code-block} python
|
||||
:linenos:
|
||||
|
||||
class SubclassExample(MovingCameraSlide):
|
||||
def construct(self):
|
||||
eq1 = MathTex("x", "=", "1")
|
||||
eq2 = MathTex("x", "=", "2")
|
||||
|
||||
self.play(Write(eq1))
|
||||
|
||||
self.next_slide()
|
||||
|
||||
self.play(
|
||||
TransformMatchingTex(eq1, eq2),
|
||||
self.camera.frame.animate.scale(0.5)
|
||||
)
|
||||
|
||||
self.wait()
|
||||
```
|
||||
|
||||
:::{note}
|
||||
If you do not plan to reuse `MovingCameraSlide` more than once, then you can
|
||||
directly write the `construct` method in the body of `MovingCameraSlide`.
|
||||
:::
|
||||
|
||||
## Advanced Example
|
||||
|
||||
A more advanced example is `ConvertExample`, which is used as demo slide and tutorial.
|
||||
|
@ -1 +1 @@
|
||||
__version__ = "4.13.2"
|
||||
__version__ = "4.13.1"
|
||||
|
@ -57,7 +57,7 @@ def verbosity_option(function: F) -> F:
|
||||
["PERF", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
||||
case_sensitive=False,
|
||||
),
|
||||
help="Verbosity of CLI output. PERF will log performances (timing) information.",
|
||||
help="Verbosity of CLI output",
|
||||
default=None,
|
||||
expose_value=False,
|
||||
envvar="MANIM_SLIDES_VERBOSITY",
|
||||
|
@ -14,7 +14,7 @@ from pydantic import ValidationError
|
||||
from pydantic.color import Color
|
||||
from PySide6.QtCore import Qt, QThread, Signal, Slot
|
||||
from PySide6.QtGui import QCloseEvent, QIcon, QImage, QKeyEvent, QPixmap, QResizeEvent
|
||||
from PySide6.QtWidgets import QApplication, QGridLayout, QLabel, QWidget
|
||||
from PySide6.QtWidgets import QApplication, QFileDialog, QGridLayout, QLabel, QWidget
|
||||
from tqdm import tqdm
|
||||
|
||||
from .commons import config_path_option, verbosity_option
|
||||
@ -906,7 +906,7 @@ def start_at_callback(
|
||||
"-s",
|
||||
"--skip-all",
|
||||
is_flag=True,
|
||||
help="Skip all slides, useful the test if slides are working. Automatically sets `--exit-after-last-slide` to True.",
|
||||
help="Skip all slides, useful the test if slides are working. Automatically sets `--skip-after-last-slide` to True.",
|
||||
)
|
||||
@click.option(
|
||||
"-r",
|
||||
@ -1027,6 +1027,22 @@ def present(
|
||||
Use `manim-slide list-scenes` to list all available scenes in a given folder.
|
||||
"""
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
app.setApplicationName("Manim Slides")
|
||||
dialog = QFileDialog()
|
||||
dialog.setDirectory(FOLDER_PATH if os.path.exists(FOLDER_PATH) else "")
|
||||
dialog.setFileMode(QFileDialog.ExistingFiles)
|
||||
dialog.setNameFilters(["JSON (*.json)", "* (*.*)"])
|
||||
if dialog.exec():
|
||||
filenames = dialog.selectedFiles()
|
||||
print(filenames)
|
||||
|
||||
# TODO:
|
||||
# - get files in selected order
|
||||
# - kill dialog
|
||||
# - add cli option (+ envvar) to prompt gui instead of cli
|
||||
# - use scenes selected from gui
|
||||
|
||||
if skip_all:
|
||||
exit_after_last_slide = True
|
||||
|
||||
|
@ -59,9 +59,7 @@ evolved very little since its inception and does not work with ManimGL.
|
||||
In 2022, Manim Slides has been created from manim-presentation, with the aim
|
||||
to make it a more complete tool, better documented, and usable on all platforms
|
||||
and with ManimCE or ManimGL. After almost a year of existence, Manim Slides has
|
||||
evolved a lot (see
|
||||
[comparison section](#comparison-with-manim-presentation)),
|
||||
has built a small community of contributors, and continues to
|
||||
evolved a lot, has built a small community of contributors, and continues to
|
||||
provide new features on a regular basis.
|
||||
|
||||
# Easy to Use Commitment
|
||||
@ -135,31 +133,6 @@ share your slides, which we discuss on our
|
||||
[Sharing your slides](https://jeertmans.github.io/manim-slides/reference/sharing.html)
|
||||
page.
|
||||
|
||||
## Comparison with manim-presentation
|
||||
|
||||
Starting from [@manim-presentation]'s original work, Manim Slides now provides
|
||||
numerous additional features.
|
||||
A non-exhaustive list of those new features is as follows:
|
||||
|
||||
* ManimGL compatibility;
|
||||
* playing slides in reverse;
|
||||
* exporting slides to HTML and PowerPoint;
|
||||
* 3D scene support;
|
||||
* multiple key inputs can map to the same action
|
||||
(e.g., useful when using a pointer);
|
||||
* optionally hiding mouse cursor when presenting;
|
||||
* recording your presentation;
|
||||
* multiple video scaling methods (for speed-vs-quality tradeoff);
|
||||
* and automatic detection of some scene parameters
|
||||
(e.g., resolution or background color).
|
||||
|
||||
The complete and up-to-date set of features Manim Slide supports is
|
||||
available in the
|
||||
[online documentation](https://jeertmans.github.io/manim-slides/).
|
||||
For new feature requests, we highly encourage users to
|
||||
[create an issue](https://github.com/jeertmans/manim-slides/issues/new/choose)
|
||||
with the appropriate template.
|
||||
|
||||
# Acknowledgements
|
||||
|
||||
We acknowledge the work of [@manim-presentation] that paved the initial structure
|
||||
|
@ -43,7 +43,7 @@ packages = [
|
||||
]
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/jeertmans/manim-slides"
|
||||
version = "4.13.2"
|
||||
version = "4.13.1"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
click = "^8.1.3"
|
||||
|
Reference in New Issue
Block a user