Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

karpfediem/manim-use_with_threading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Manim python API with threading (Minimal examples)

This is a showcase of how manim fails to render video output when used within renamed threads.

Threads can be manually renamed or automatically renamed by running ThreadPools in certain situations (such as spawning new process tasks within threads).

The tests expect the output file to stay the same as the configured file (ending in .mp4).

However when Manim detects the thread name is not equal to 'MainThread' it will put the play command into a queue, which causes manim to not render any animation.

See scene.py

if threading.current_thread().name != "MainThread":
    #...
    self.queue.put(("play", args, kwargs))
    return

Since the manim renderer has no configured animations (renderer.num_plays stays 0) it defaults to render the last frame as a PNG output.

Install

poetry install

Run tests

pytest

About

MRE for manimce

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages