Skip to main content

A manim plugin that enables rendering manim scenes using the python main function.

Project description

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 manim-main-function

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.

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()
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manim_main_function-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manim_main_function-0.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file manim_main_function-0.1.1.tar.gz.

File metadata

  • Download URL: manim_main_function-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for manim_main_function-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0823f937835846c3738671fd7452baace61f1299a588bd5263337ce936576926
MD5 f6134d7a9da13eabb52064bdfe15af85
BLAKE2b-256 224459e51e8910a97d1a2e9bca15e0ccb122c158361bf53b9ae78052e27db7a7

See more details on using hashes here.

File details

Details for the file manim_main_function-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for manim_main_function-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee101762d124542f558a41461a66c000c681dc94e55cc9819f2daf97ae69fd5e
MD5 1246a94414e2d4f511f1dd1a408d2e75
BLAKE2b-256 93659211b441f5475d44bfdb96c6744a1fa92115711c037c109a5c9a508f0838

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page