Metadata-Version: 2.3
Name: manim-main-function
Version: 0.1.0
Summary: A manim plugin that enables rendering manim scenes using the python main function.
Author: Alexander Nasuta
Author-email: alexander.nasuta@wzl-iqs.rwth-aachen.de
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: manim (>=0.19.0,<0.20.0)
Requires-Dist: rich (>=14.0.0,<15.0.0)
Description-Content-Type: text/markdown


# About this Project

This project is a Python Module that let you use manim using a python API instead of the command line.
Pressing the green run button in your IDE will render the scene or show the last frame of the scene.

# Installation

Install the package with pip:
```
   pip install <<todo>>
```

# Usage

**Please make sure you have manim installed and running on your machine**

To use the module, you just need to let your scene inherit from the `ManinMainFunctions` class.
This class provides a set of functions that allow you to render the scene using the main function instead of the command line.

Below is are two examples of how to use the Module.

```python
import manim as m
# import ManinMainFunctions
from manim_main_function.mmf import ManinMainFunction


# Add 'ManinMainFunctions' to your scene class to enable the main function
class ShowLastFrameExample(ManinMainFunction, m.Scene):

    def construct(self):
        my_text = m.Text("Hello World", color=m.BLUE)

        self.add(my_text)


if __name__ == '__main__':
    # You can now render Manim Scenes using the main function instead of the command line!
    ShowLastFrameExample.show_last_frame()
```

```python
import manim as m
# import ManinMainFunctions
from manim_main_function.mmf import ManinMainFunction


# Add 'ManinMainFunctions' to your scene class to enable the main function
class ShowLastFrameExample(ManinMainFunction, m.Scene):

    def construct(self):
        my_text = m.Text("Hello World", color=m.BLUE)

        self.play(
            m.FadeIn(my_text)
        )


if __name__ == '__main__':
    # You can now render Manim Scenes using the main function instead of the command line!
    ShowLastFrameExample.render_video_medium()  # renders the video with the -pqm flags

    # Feel free to uncomment the following lines to render the video with different quality settings:
    # 
    # ShowLastFrameExample.render_video_low() # renders the video with the -pql flags
    # ShowLastFrameExample.render_video_high() # renders the video with the -pqh flags
    # ShowLastFrameExample.render_video_4k() # renders the video with the -pqk flags
    # ShowLastFrameExample.render_video_4k_without_cache() # renders the video with the -pqk flags and without cache (--disable_caching flag)


```
## Available Functions
- `render_video_low()`: Renders the video with the -pql flags
- `render_video_medium()`: Renders the video with the -pqm flags
- `render_video_high()`: Renders the video with the -pqh flags
- `render_video_4k()`: Renders the video with the -pqk flags
- `render_video_4k_without_cache()`: Renders the video with the -pqk flags and without cache (--disable_caching flag)
- `show_last_frame()`: Shows the last frame of the scene
