Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

fix(3183): render in named threads, limit condition (#3191)

karpfediemca8a77d09178
diff --git a/manim/scene/scene.py b/manim/scene/scene.py
index a1b436ae0..dc519b9eb 100644
--- a/manim/scene/scene.py
+++ b/manim/scene/scene.py
@@ -1053,8 +1053,12 @@ class Scene:
All other keywords are passed to the renderer.
"""
- # Make sure this is running on the main thread
- if threading.current_thread().name != "MainThread":
+ # If we are in interactive embedded mode, make sure this is running on the main thread (required for OpenGL)
+ if (
+ self.interactive_mode
+ and config.renderer == RendererType.OPENGL
+ and threading.current_thread().name != "MainThread"
+ ):
kwargs.update(
{
"subcaption": subcaption,