Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Merge branch 'master' into pr

Grant Sanderson7d5432ce8b98
diff --cc utils/output_directory_getters.py
index 9c1c90f0c,6a52f1c87..bd05def99
--- a/utils/output_directory_getters.py
+++ b/utils/output_directory_getters.py
@@@ -1,8 -1,7 +1,8 @@@
import inspect
import os
+from constants import THIS_DIR
- from constants import ANIMATIONS_DIR
+ from constants import VIDEO_DIR
def add_extension_if_not_present(file_name, extension):
@@@ -22,10 -21,14 +22,10 @@@ def guarantee_existance(path)
def get_scene_output_directory(scene_class):
file_path = os.path.abspath(inspect.getfile(scene_class))
- # TODO, is there a better way to do this?
- parts = file_path.split(os.path.sep)
- if "manim" in parts:
- sub_parts = parts[parts.index("manim") + 1:]
- file_path = os.path.join(*sub_parts)
+ file_path = os.path.relpath(file_path, THIS_DIR)
file_path = file_path.replace(".pyc", "")
file_path = file_path.replace(".py", "")
- return guarantee_existance(os.path.join(ANIMATIONS_DIR, file_path))
+ return guarantee_existance(os.path.join(VIDEO_DIR, file_path))
def get_movie_output_directory(scene_class, camera_config, frame_duration):