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 <<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.

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.0.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.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manim_main_function-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 14fe95eff30ab0316b724069d8700c39a0031e4215907109579efa235f2fceea
MD5 d683a335aba68ac220dfbd37ede73b66
BLAKE2b-256 d6d00b27311c4443976c3d65e17394140732dcbd001bb1d923947c8a2a0a055a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for manim_main_function-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 062fb5cd5b5f951284e89a5619d21c1678a31f56d7177e6e4512c4ab8ed1925e
MD5 4aea251531bd7bb22b67d3ea6c002ae9
BLAKE2b-256 ded3eb780c8bf5d25dab980ada6bc36e89ddf7b34891ce799efb747a5ec9d45b

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