def get_customization(): if not CUSTOMIZATION: CUSTOMIZATION.update(get_custom_defaults()) 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() # Assumes all shaders are written into manimlib/shaders directories["shaders"] = os.path.join(get_manim_dir(), "manimlib", "shaders") return CUSTOMIZATION
def get_tex_config(): """ Returns a dict which should look something like this: { "executable": "latex", "template_file": "tex_template.tex", "intermediate_filetype": "dvi", "text_to_replace": "YourTextHere", "tex_body": "..." } """ # Only load once, then save thereafter if not SAVED_TEX_CONFIG: custom_defaults = get_custom_defaults() SAVED_TEX_CONFIG.update(custom_defaults["tex"]) # Read in template file template_filename = os.path.join( get_manim_dir(), "manimlib", "tex_templates", SAVED_TEX_CONFIG["template_file"], ) with open(template_filename, "r") as file: SAVED_TEX_CONFIG["tex_body"] = file.read() return SAVED_TEX_CONFIG
def construct(self): exec(get_custom_defaults()["universal_import_line"]) self.embed()