2021-01-15 10:16:37 -10:00
|
|
|
import os
|
|
|
|
import tempfile
|
2024-12-04 20:50:42 -06:00
|
|
|
import appdirs
|
2021-01-15 10:16:37 -10:00
|
|
|
|
2021-02-07 21:38:19 +08:00
|
|
|
from manimlib.config import get_custom_config
|
2021-01-15 10:16:37 -10:00
|
|
|
from manimlib.config import get_manim_dir
|
|
|
|
|
2022-04-12 19:19:59 +08:00
|
|
|
|
2021-01-15 10:16:37 -10:00
|
|
|
CUSTOMIZATION = {}
|
|
|
|
|
|
|
|
|
|
|
|
def get_customization():
|
|
|
|
if not CUSTOMIZATION:
|
2024-12-05 10:09:15 -06:00
|
|
|
print(CUSTOMIZATION)
|
2021-02-07 21:38:19 +08:00
|
|
|
CUSTOMIZATION.update(get_custom_config())
|
2024-12-05 10:09:15 -06:00
|
|
|
print(CUSTOMIZATION)
|
2021-01-15 10:16:37 -10:00
|
|
|
directories = CUSTOMIZATION["directories"]
|
|
|
|
# Unless user has specified otherwise, use the system default temp
|
|
|
|
# directory for storing tex files, mobject_data, etc.
|
|
|
|
if not directories["temporary_storage"]:
|
|
|
|
directories["temporary_storage"] = tempfile.gettempdir()
|
|
|
|
|
2024-12-04 20:50:42 -06:00
|
|
|
if not directories["cache"]:
|
|
|
|
directories["cache"] = appdirs.user_cache_dir("manim")
|
|
|
|
|
2021-01-15 10:16:37 -10:00
|
|
|
# Assumes all shaders are written into manimlib/shaders
|
|
|
|
directories["shaders"] = os.path.join(
|
|
|
|
get_manim_dir(), "manimlib", "shaders"
|
|
|
|
)
|
|
|
|
return CUSTOMIZATION
|