Skip to main content

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

Project description

PyPI version License

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.2.tar.gz (3.1 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.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manim_main_function-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 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.2.tar.gz
Algorithm Hash digest
SHA256 f0a61a500043c4d86b83c4e1466483178067d9943d34c27a17eb5d2e7de5383a
MD5 1e45a5e3d4df735cbfe59ff2ad9f0efd
BLAKE2b-256 dbf7cfa91fb8348d24e897f6d646bdb9a08e8c2df23c1ddd27a70c1c7580a49b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for manim_main_function-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6a58ea641b85e73c6c5174a80530633dc034a39385b7b4b0fc44e7ca21ab8b4
MD5 0de0975702a99e6a9123a4d585b445db
BLAKE2b-256 3ca5277156a75999d1d94c437b914bb2679f74c9ff8a0bb48acf4eadd32a9483

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