file_path
stringlengths
29
93
content
stringlengths
0
117k
manim_ManimCommunity/manim/mobject/geometry/shape_matchers.py
"""Mobjects used to mark and annotate other mobjects.""" from __future__ import annotations __all__ = ["SurroundingRectangle", "BackgroundRectangle", "Cross", "Underline"] from typing import Any from typing_extensions import Self from manim import config, logger from manim.constants import * from manim.mobject.geo...
manim_ManimCommunity/manim/mobject/geometry/labeled.py
r"""Mobjects that inherit from lines and contain a label along the length.""" from __future__ import annotations __all__ = ["LabeledLine", "LabeledArrow"] from manim.constants import * from manim.mobject.geometry.line import Arrow, Line from manim.mobject.geometry.shape_matchers import ( BackgroundRectangle, ...
manim_ManimCommunity/manim/mobject/types/__init__.py
"""Specialized mobject base classes. Modules ======= .. autosummary:: :toctree: ../reference ~image_mobject ~point_cloud_mobject ~vectorized_mobject """
manim_ManimCommunity/manim/mobject/types/image_mobject.py
"""Mobjects representing raster images.""" from __future__ import annotations __all__ = ["AbstractImageMobject", "ImageMobject", "ImageMobjectFromCamera"] import pathlib import numpy as np from PIL import Image from PIL.Image import Resampling from manim.mobject.geometry.shape_matchers import SurroundingRectangle ...
manim_ManimCommunity/manim/mobject/types/vectorized_mobject.py
"""Mobjects that use vector graphics.""" from __future__ import annotations __all__ = [ "VMobject", "VGroup", "VDict", "VectorizedPoint", "CurvesAsSubmobjects", "DashedVMobject", ] import itertools as it import sys from typing import ( TYPE_CHECKING, Callable, Generator, Hash...
manim_ManimCommunity/manim/mobject/types/point_cloud_mobject.py
"""Mobjects representing point clouds.""" from __future__ import annotations __all__ = ["PMobject", "Mobject1D", "Mobject2D", "PGroup", "PointCloudDot", "Point"] import numpy as np from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL from manim.mobject.opengl.opengl_point_cloud_mobject import OpenG...
manim_ManimCommunity/manim/utils/debug.py
"""Debugging utilities.""" from __future__ import annotations __all__ = ["print_family", "index_labels"] from manim.mobject.mobject import Mobject from manim.mobject.text.numbers import Integer from ..mobject.types.vectorized_mobject import VGroup from .color import BLACK def print_family(mobject, n_tabs=0): ...
manim_ManimCommunity/manim/utils/family.py
from __future__ import annotations import itertools as it from typing import Iterable from ..mobject.mobject import Mobject from ..utils.iterables import remove_list_redundancies __all__ = ["extract_mobject_family_members"] def extract_mobject_family_members( mobjects: Iterable[Mobject], use_z_index=False,...
manim_ManimCommunity/manim/utils/tex.py
"""Utilities for processing LaTeX templates.""" from __future__ import annotations __all__ = [ "TexTemplate", ] import copy import re import warnings from dataclasses import dataclass, field from pathlib import Path from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from typing_extensions import Self ...
manim_ManimCommunity/manim/utils/tex_file_writing.py
"""Interface for writing, compiling, and converting ``.tex`` files. .. SEEALSO:: :mod:`.mobject.svg.tex_mobject` """ from __future__ import annotations import hashlib import os import re import unicodedata from pathlib import Path from typing import Iterable from manim.utils.tex import TexTemplate from .. im...
manim_ManimCommunity/manim/utils/__init__.py
manim_ManimCommunity/manim/utils/deprecation.py
"""Decorators for deprecating classes, functions and function parameters.""" from __future__ import annotations __all__ = ["deprecated", "deprecated_params"] import inspect import re from typing import Any, Callable, Iterable from decorator import decorate, decorator from .. import logger def _get_callable_info...
manim_ManimCommunity/manim/utils/ipython_magic.py
"""Utilities for using Manim with IPython (in particular: Jupyter notebooks)""" from __future__ import annotations import mimetypes import os import shutil from datetime import datetime from pathlib import Path from typing import Any from manim import Group, config, logger, tempconfig from manim.__main__ import main...
manim_ManimCommunity/manim/utils/iterables.py
"""Operations on iterables.""" from __future__ import annotations __all__ = [ "adjacent_n_tuples", "adjacent_pairs", "all_elements_are_instances", "concatenate_lists", "list_difference_update", "list_update", "listify", "make_even", "make_even_by_cycling", "remove_list_redundan...
manim_ManimCommunity/manim/utils/caching.py
from __future__ import annotations from typing import Callable from .. import config, logger from ..utils.hashing import get_hash_from_play_call __all__ = ["handle_caching_play"] def handle_caching_play(func: Callable[..., None]): """Decorator that returns a wrapped version of func that will compute the ha...
manim_ManimCommunity/manim/utils/opengl.py
from __future__ import annotations import numpy as np import numpy.linalg as linalg from .. import config depth = 20 __all__ = [ "matrix_to_shader_input", "orthographic_projection_matrix", "perspective_projection_matrix", "translation_matrix", "x_rotation_matrix", "y_rotation_matrix", "z...
manim_ManimCommunity/manim/utils/simple_functions.py
"""A collection of simple functions.""" from __future__ import annotations __all__ = [ "binary_search", "choose", "clip", "sigmoid", ] import inspect from functools import lru_cache from types import MappingProxyType from typing import Callable import numpy as np from scipy import special def bin...
manim_ManimCommunity/manim/utils/config_ops.py
"""Utilities that might be useful for configuration dictionaries.""" from __future__ import annotations __all__ = [ "merge_dicts_recursively", "update_dict_recursively", "DictAsObject", ] import itertools as it import numpy as np def merge_dicts_recursively(*dicts): """ Creates a dict whose k...
manim_ManimCommunity/manim/utils/module_ops.py
from __future__ import annotations import importlib.util import inspect import os import re import sys import types import warnings from pathlib import Path from .. import config, console, constants, logger from ..scene.scene_file_writer import SceneFileWriter __all__ = ["scene_classes_from_file"] def get_module(f...
manim_ManimCommunity/manim/utils/tex_templates.py
"""A library of LaTeX templates.""" from __future__ import annotations __all__ = [ "TexTemplateLibrary", "TexFontTemplates", ] from .tex import * # This file makes TexTemplateLibrary and TexFontTemplates available for use in manim Tex and MathTex objects. def _new_ams_template(): """Returns a simple Te...
manim_ManimCommunity/manim/utils/space_ops.py
"""Utility functions for two- and three-dimensional vectors.""" from __future__ import annotations import itertools as it from typing import TYPE_CHECKING, Sequence import numpy as np from mapbox_earcut import triangulate_float32 as earcut from scipy.spatial.transform import Rotation from manim.constants import DOW...
manim_ManimCommunity/manim/utils/paths.py
"""Functions determining transformation paths between sets of points.""" from __future__ import annotations __all__ = [ "straight_path", "path_along_arc", "clockwise_path", "counterclockwise_path", ] from typing import Callable import numpy as np from ..constants import OUT from ..utils.bezier imp...
manim_ManimCommunity/manim/utils/commands.py
from __future__ import annotations import json import os from pathlib import Path from subprocess import run from typing import Generator __all__ = [ "capture", "get_video_metadata", "get_dir_layout", ] def capture(command, cwd=None, command_input=None): p = run(command, cwd=cwd, input=command_input...
manim_ManimCommunity/manim/utils/exceptions.py
from __future__ import annotations __all__ = [ "EndSceneEarlyException", "RerunSceneException", "MultiAnimationOverrideException", ] class EndSceneEarlyException(Exception): pass class RerunSceneException(Exception): pass class MultiAnimationOverrideException(Exception): pass
manim_ManimCommunity/manim/utils/rate_functions.py
"""A selection of rate functions, i.e., *speed curves* for animations. Please find a standard list at https://easings.net/. Here is a picture for the non-standard ones .. manim:: RateFuncExample :save_last_frame: class RateFuncExample(Scene): def construct(self): x = VGroup() f...
manim_ManimCommunity/manim/utils/family_ops.py
from __future__ import annotations import itertools as it __all__ = [ "extract_mobject_family_members", "restructure_list_to_exclude_certain_family_members", ] def extract_mobject_family_members(mobject_list, only_those_with_points=False): result = list(it.chain(*(mob.get_family() for mob in mobject_lis...
manim_ManimCommunity/manim/utils/unit.py
"""Implement the Unit class.""" from __future__ import annotations import numpy as np from .. import config, constants __all__ = ["Pixels", "Degrees", "Munits", "Percent"] class _PixelUnits: def __mul__(self, val): return val * config.frame_width / config.pixel_width def __rmul__(self, val): ...
manim_ManimCommunity/manim/utils/hashing.py
"""Utilities for scene caching.""" from __future__ import annotations import collections import copy import inspect import json import typing import zlib from time import perf_counter from types import FunctionType, MappingProxyType, MethodType, ModuleType from typing import Any import numpy as np from manim.animat...
manim_ManimCommunity/manim/utils/images.py
"""Image manipulation utilities.""" from __future__ import annotations __all__ = [ "get_full_raster_image_path", "drag_pixels", "invert_image", "change_to_rgba_array", ] from pathlib import Path import numpy as np from PIL import Image from .. import config from ..utils.file_ops import seek_full_pa...
manim_ManimCommunity/manim/utils/bezier.py
"""Utility functions related to Bézier curves.""" from __future__ import annotations from manim.typing import ( BezierPoints, ColVector, MatrixMN, Point3D, Point3D_Array, PointDType, QuadraticBezierPoints, QuadraticBezierPoints_Array, ) __all__ = [ "bezier", "partial_bezier_po...
manim_ManimCommunity/manim/utils/file_ops.py
"""Utility functions for interacting with the file system.""" from __future__ import annotations __all__ = [ "add_extension_if_not_present", "guarantee_existence", "guarantee_empty_existence", "seek_full_path_from_defaults", "modify_atime", "open_file", "is_mp4_format", "is_gif_format"...
manim_ManimCommunity/manim/utils/parameter_parsing.py
from __future__ import annotations from types import GeneratorType from typing import Iterable, TypeVar T = TypeVar("T") def flatten_iterable_parameters( args: Iterable[T | Iterable[T] | GeneratorType], ) -> list[T]: """Flattens an iterable of parameters into a list of parameters. Parameters ------...
manim_ManimCommunity/manim/utils/sounds.py
"""Sound-related utility functions.""" from __future__ import annotations __all__ = [ "get_full_sound_file_path", ] from .. import config from ..utils.file_ops import seek_full_path_from_defaults # Still in use by add_sound() function in scene_file_writer.py def get_full_sound_file_path(sound_file_name): ...
manim_ManimCommunity/manim/utils/docbuild/__init__.py
"""Utilities for building the Manim documentation. For more information about the Manim documentation building, see: - :doc:`/contributing/development`, specifically the ``Documentation`` bullet point under :ref:`polishing-changes-and-submitting-a-pull-request` - :doc:`/contributing/docs` .. autosummary:: ...
manim_ManimCommunity/manim/utils/docbuild/module_parsing.py
"""Read and parse all the Manim modules and extract documentation from them.""" from __future__ import annotations import ast from pathlib import Path from typing_extensions import TypeAlias __all__ = ["parse_module_attributes"] AliasInfo: TypeAlias = dict[str, str] """Dictionary with a `definition` key containin...
manim_ManimCommunity/manim/utils/docbuild/autocolor_directive.py
"""A directive for documenting colors in Manim.""" from __future__ import annotations import inspect from typing import TYPE_CHECKING from docutils import nodes from docutils.parsers.rst import Directive from manim import ManimColor if TYPE_CHECKING: from sphinx.application import Sphinx __all__ = ["ManimColo...
manim_ManimCommunity/manim/utils/docbuild/manim_directive.py
r""" A directive for including Manim videos in a Sphinx document =========================================================== When rendering the HTML documentation, the ``.. manim::`` directive implemented here allows to include rendered videos. Its basic usage that allows processing **inline content** looks as follow...
manim_ManimCommunity/manim/utils/docbuild/autoaliasattr_directive.py
"""A directive for documenting type aliases and other module-level attributes.""" from __future__ import annotations from typing import TYPE_CHECKING from docutils import nodes from docutils.parsers.rst import Directive from docutils.statemachine import ViewList from manim.utils.docbuild.module_parsing import parse...
manim_ManimCommunity/manim/utils/color/XKCD.py
"""Colors from the XKCD Color Name Survey XKCD is a popular `web comic <https://xkcd.com/353/>`__ created by Randall Munroe. His "`Color Name Survey <http://blog.xkcd.com/2010/05/03/color-survey-results/>`__" (with 200000 participants) resulted in a list of nearly 1000 color names. While the ``XKCD`` module is expose...
manim_ManimCommunity/manim/utils/color/__init__.py
"""Utilities for working with colors and predefined color constants. Color data structure -------------------- .. autosummary:: :toctree: ../reference core Predefined colors ----------------- There are several predefined colors available in Manim: - The colors listed in :mod:`.color.manim_colors` are loade...
manim_ManimCommunity/manim/utils/color/AS2700.py
"""Australian Color Standard In 1985 the Australian Independent Color Standard AS 2700 was created. In this standard, all colors can be identified via a category code (one of B -- Blue, G -- Green, N -- Neutrals (grey), P -- Purple, R -- Red, T -- Blue/Green, X -- Yellow/Red, Y -- Yellow) and a number. The colors also...
manim_ManimCommunity/manim/utils/color/X11.py
# from https://www.w3schools.com/colors/colors_x11.asp """X11 Colors These color and their names (taken from https://www.w3schools.com/colors/colors_x11.asp) were developed at the Massachusetts Intitute of Technology (MIT) during the development of color based computer display system. To use the colors from this lis...
manim_ManimCommunity/manim/utils/color/core.py
"""Manim's (internal) color data structure and some utilities for color conversion. This module contains the implementation of :class:`.ManimColor`, the data structure internally used to represent colors. The preferred way of using these colors is by importing their constants from manim: .. code-block:: pycon >...
manim_ManimCommunity/manim/utils/color/BS381.py
"""British Color Standard This module contains colors defined in one of the British Standards for colors, BS381C. This standard specifies colors used in identification, coding, and other special purposes. See https://www.britishstandardcolour.com/ for more information. To use the colors from this list, access them di...
manim_ManimCommunity/manim/utils/color/manim_colors.py
"""Colors included in the global name space. These colors form Manim's default color space. .. manim:: ColorsOverview :save_last_frame: :hide_source: import manim.utils.color.manim_colors as Colors class ColorsOverview(Scene): def construct(self): def color_group(color): ...
manim_ManimCommunity/manim/utils/testing/__init__.py
"""Utilities for Manim tests using `pytest <https://pytest.org>`_. For more information about Manim testing, see: - :doc:`/contributing/development`, specifically the ``Tests`` bullet point under :ref:`polishing-changes-and-submitting-a-pull-request` - :doc:`/contributing/testing` .. autosummary:: :toctre...
manim_ManimCommunity/manim/utils/testing/_test_class_makers.py
from __future__ import annotations from typing import Callable from manim.scene.scene import Scene from manim.scene.scene_file_writer import SceneFileWriter from ._frames_testers import _FramesTester def _make_test_scene_class( base_scene: type[Scene], construct_test: Callable[[Scene], None], test_rend...
manim_ManimCommunity/manim/utils/testing/frames_comparison.py
from __future__ import annotations import functools import inspect from pathlib import Path from typing import Callable import cairo import pytest from _pytest.fixtures import FixtureRequest from manim import Scene from manim._config import tempconfig from manim._config.utils import ManimConfig from manim.camera.thr...
manim_ManimCommunity/manim/utils/testing/_show_diff.py
from __future__ import annotations import logging import warnings import numpy as np def show_diff_helper( frame_number: int, frame_data: np.ndarray, expected_frame_data: np.ndarray, control_data_filename: str, ): """Will visually display with matplotlib differences between frame generated and t...
manim_ManimCommunity/manim/utils/testing/_frames_testers.py
from __future__ import annotations import contextlib import warnings from pathlib import Path import numpy as np from manim import logger from ._show_diff import show_diff_helper FRAME_ABSOLUTE_TOLERANCE = 1.01 FRAME_MISMATCH_RATIO_TOLERANCE = 1e-5 class _FramesTester: def __init__(self, file_path: Path, sho...
manim_ManimCommunity/manim/camera/moving_camera.py
"""A camera able to move through a scene. .. SEEALSO:: :mod:`.moving_camera_scene` """ from __future__ import annotations __all__ = ["MovingCamera"] import numpy as np from .. import config from ..camera.camera import Camera from ..constants import DOWN, LEFT, RIGHT, UP from ..mobject.frame import ScreenRect...
manim_ManimCommunity/manim/camera/mapping_camera.py
"""A camera that allows mapping between objects.""" from __future__ import annotations __all__ = ["MappingCamera", "OldMultiCamera", "SplitScreenCamera"] import math import numpy as np from ..camera.camera import Camera from ..mobject.types.vectorized_mobject import VMobject from ..utils.config_ops import DictAsOb...
manim_ManimCommunity/manim/camera/__init__.py
manim_ManimCommunity/manim/camera/three_d_camera.py
"""A camera that can be positioned and oriented in three-dimensional space.""" from __future__ import annotations __all__ = ["ThreeDCamera"] from typing import Callable import numpy as np from manim.mobject.mobject import Mobject from manim.mobject.three_d.three_d_utils import ( get_3d_vmob_end_corner, ge...
manim_ManimCommunity/manim/camera/multi_camera.py
"""A camera supporting multiple perspectives.""" from __future__ import annotations __all__ = ["MultiCamera"] from manim.mobject.types.image_mobject import ImageMobject from ..camera.moving_camera import MovingCamera from ..utils.iterables import list_difference_update class MultiCamera(MovingCamera): """Cam...
manim_ManimCommunity/manim/camera/camera.py
"""A camera converts the mobjects contained in a Scene into an array of pixels.""" from __future__ import annotations __all__ = ["Camera", "BackgroundColoredVMobjectDisplayer"] import copy import itertools as it import operator as op import pathlib from functools import reduce from typing import Any, Callable, Iter...
manim_ManimCommunity/manim/cli/__init__.py
manim_ManimCommunity/manim/cli/default_group.py
"""``DefaultGroup`` allows a subcommand to act as the main command. In particular, this class is what allows ``manim`` to act as ``manim render``. .. note:: This is a vendored version of https://github.com/click-contrib/click-default-group/ under the BSD 3-Clause "New" or "Revised" License. This library ...
manim_ManimCommunity/manim/cli/plugins/__init__.py
manim_ManimCommunity/manim/cli/plugins/commands.py
"""Manim's plugin subcommand. Manim's plugin subcommand is accessed in the command-line interface via ``manim plugin``. Here you can specify options, subcommands, and subgroups for the plugin group. """ from __future__ import annotations import cloup from ...constants import CONTEXT_SETTINGS, EPILOG from ...plugins...
manim_ManimCommunity/manim/cli/init/__init__.py
manim_ManimCommunity/manim/cli/init/commands.py
"""Manim's init subcommand. Manim's init subcommand is accessed in the command-line interface via ``manim init``. Here you can specify options, subcommands, and subgroups for the init group. """ from __future__ import annotations import configparser from pathlib import Path import click import cloup from ... impor...
manim_ManimCommunity/manim/cli/checkhealth/__init__.py
manim_ManimCommunity/manim/cli/checkhealth/commands.py
"""A CLI utility helping to diagnose problems with your Manim installation. """ from __future__ import annotations import sys import click import cloup from .checks import HEALTH_CHECKS __all__ = ["checkhealth"] @cloup.command( context_settings=None, ) def checkhealth(): """This subcommand checks whethe...
manim_ManimCommunity/manim/cli/checkhealth/checks.py
"""Auxiliary module for the checkhealth subcommand, contains the actual check implementations.""" from __future__ import annotations import os import shutil import subprocess from typing import Callable from ..._config import config __all__ = ["HEALTH_CHECKS"] HEALTH_CHECKS = [] def healthcheck( description:...
manim_ManimCommunity/manim/cli/render/render_options.py
from __future__ import annotations import re from cloup import Choice, option, option_group from manim.constants import QUALITIES, RendererType from ... import logger __all__ = ["render_options"] def validate_scene_range(ctx, param, value): try: start = int(value) return (start,) except E...
manim_ManimCommunity/manim/cli/render/__init__.py
manim_ManimCommunity/manim/cli/render/commands.py
"""Manim's default subcommand, render. Manim's render subcommand is accessed in the command-line interface via ``manim``, but can be more explicitly accessed with ``manim render``. Here you can specify options, and arguments for the render command. """ from __future__ import annotations import http.client import jso...
manim_ManimCommunity/manim/cli/render/ease_of_access_options.py
from __future__ import annotations from cloup import Choice, option, option_group __all__ = ["ease_of_access_options"] ease_of_access_options = option_group( "Ease of access options", option( "--progress_bar", default=None, show_default=False, type=Choice( ["displa...
manim_ManimCommunity/manim/cli/render/global_options.py
from __future__ import annotations import re from cloup import Choice, option, option_group from ... import logger __all__ = ["global_options"] def validate_gui_location(ctx, param, value): if value: try: x_offset, y_offset = map(int, re.split(r"[;,\-]", value)) return (x_offse...
manim_ManimCommunity/manim/cli/render/output_options.py
from __future__ import annotations from cloup import IntRange, Path, option, option_group __all__ = ["output_options"] output_options = option_group( "Output options", option( "-o", "--output_file", type=str, default=None, help="Specify the filename(s) of the rendered ...
manim_ManimCommunity/manim/cli/cfg/__init__.py
manim_ManimCommunity/manim/cli/cfg/group.py
"""Manim's cfg subcommand. Manim's cfg subcommand is accessed in the command-line interface via ``manim cfg``. Here you can specify options, subcommands, and subgroups for the cfg group. """ from __future__ import annotations from ast import literal_eval from pathlib import Path import cloup from rich.errors import...
manim_ManimCommunity/manim/gui/__init__.py
manim_ManimCommunity/manim/gui/gui.py
from __future__ import annotations from pathlib import Path try: import dearpygui.dearpygui as dpg dearpygui_imported = True except ImportError: dearpygui_imported = False from .. import __version__, config from ..utils.module_ops import scene_classes_from_file __all__ = ["configure_pygui"] if dearpy...
manim_ManimCommunity/manim/_config/__init__.py
"""Set the global config and logger.""" from __future__ import annotations import logging from contextlib import contextmanager from typing import Any, Generator from .cli_colors import parse_cli_ctx from .logger_utils import make_logger from .utils import ManimConfig, ManimFrame, make_config_parser __all__ = [ ...
manim_ManimCommunity/manim/_config/logger_utils.py
"""Utilities to create and set the logger. Manim's logger can be accessed as ``manim.logger``, or as ``logging.getLogger("manim")``, once the library has been imported. Manim also exports a second object, ``console``, which should be used to print on screen messages that need not be logged. Both ``logger`` and ``con...
manim_ManimCommunity/manim/_config/cli_colors.py
from __future__ import annotations import configparser from cloup import Context, HelpFormatter, HelpTheme, Style __all__ = ["parse_cli_ctx"] def parse_cli_ctx(parser: configparser.SectionProxy) -> Context: formatter_settings: dict[str, str | int] = { "indent_increment": int(parser["indent_increment"])...
manim_ManimCommunity/manim/_config/utils.py
"""Utilities to create and set the config. The main class exported by this module is :class:`ManimConfig`. This class contains all configuration options, including frame geometry (e.g. frame height/width, frame rate), output (e.g. directories, logging), styling (e.g. background color, transparency), and general behav...
manim_ManimCommunity/manim/opengl/__init__.py
from __future__ import annotations try: from dearpygui import dearpygui as dpg except ImportError: pass from manim.mobject.opengl.dot_cloud import * from manim.mobject.opengl.opengl_image_mobject import * from manim.mobject.opengl.opengl_mobject import * from manim.mobject.opengl.opengl_point_cloud_mobject i...
manim_ManimCommunity/manim/animation/rotation.py
"""Animations related to rotation.""" from __future__ import annotations __all__ = ["Rotating", "Rotate"] from typing import TYPE_CHECKING, Callable, Sequence import numpy as np from ..animation.animation import Animation from ..animation.transform import Transform from ..constants import OUT, PI, TAU from ..utils...
manim_ManimCommunity/manim/animation/fading.py
"""Fading in and out of view. .. manim:: Fading class Fading(Scene): def construct(self): tex_in = Tex("Fade", "In").scale(3) tex_out = Tex("Fade", "Out").scale(3) self.play(FadeIn(tex_in, shift=DOWN, scale=0.66)) self.play(ReplacementTransform(tex_in, tex_o...
manim_ManimCommunity/manim/animation/composition.py
"""Tools for displaying multiple animations at once.""" from __future__ import annotations import types from typing import TYPE_CHECKING, Callable, Iterable, Sequence import numpy as np from manim.mobject.opengl.opengl_mobject import OpenGLGroup from manim.utils.parameter_parsing import flatten_iterable_parameters...
manim_ManimCommunity/manim/animation/__init__.py
manim_ManimCommunity/manim/animation/transform_matching_parts.py
"""Animations that try to transform Mobjects while keeping track of identical parts.""" from __future__ import annotations __all__ = ["TransformMatchingShapes", "TransformMatchingTex"] from typing import TYPE_CHECKING import numpy as np from manim.mobject.opengl.opengl_mobject import OpenGLGroup, OpenGLMobject fro...
manim_ManimCommunity/manim/animation/creation.py
r"""Animate the display or removal of a mobject from a scene. .. manim:: CreationModule :hide_source: from manim import ManimBanner class CreationModule(Scene): def construct(self): s1 = Square() s2 = Square() s3 = Square() s4 = Square() ...
manim_ManimCommunity/manim/animation/movement.py
"""Animations related to movement.""" from __future__ import annotations __all__ = [ "Homotopy", "SmoothedVectorizedHomotopy", "ComplexHomotopy", "PhaseFlow", "MoveAlongPath", ] from typing import TYPE_CHECKING, Any, Callable import numpy as np from ..animation.animation import Animation from ....
manim_ManimCommunity/manim/animation/changing.py
"""Animation of a mobject boundary and tracing of points.""" from __future__ import annotations __all__ = ["AnimatedBoundary", "TracedPath"] from typing import Callable from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL from manim.mobject.types.vectorized_mobject import VGroup, VMobject from mani...
manim_ManimCommunity/manim/animation/growing.py
"""Animations that introduce mobjects to scene by growing them from points. .. manim:: Growing class Growing(Scene): def construct(self): square = Square() circle = Circle() triangle = Triangle() arrow = Arrow(LEFT, RIGHT) star = Star() ...
manim_ManimCommunity/manim/animation/numbers.py
"""Animations for changing numbers.""" from __future__ import annotations __all__ = ["ChangingDecimal", "ChangeDecimalToValue"] import typing from manim.mobject.text.numbers import DecimalNumber from ..animation.animation import Animation from ..utils.bezier import interpolate class ChangingDecimal(Animation): ...
manim_ManimCommunity/manim/animation/specialized.py
from __future__ import annotations __all__ = ["Broadcast"] from typing import Any, Sequence from manim.animation.transform import Restore from ..constants import * from .composition import LaggedStart class Broadcast(LaggedStart): """Broadcast a mobject starting from an ``initial_width``, up to the actual siz...
manim_ManimCommunity/manim/animation/speedmodifier.py
"""Utilities for modifying the speed at which animations are played.""" from __future__ import annotations import inspect import types from typing import Callable from numpy import piecewise from ..animation.animation import Animation, Wait, prepare_animation from ..animation.composition import AnimationGroup from ...
manim_ManimCommunity/manim/animation/transform.py
"""Animations transforming one mobject into another.""" from __future__ import annotations __all__ = [ "Transform", "ReplacementTransform", "TransformFromCopy", "ClockwiseTransform", "CounterclockwiseTransform", "MoveToTarget", "ApplyMethod", "ApplyPointwiseFunction", "ApplyPointwi...
manim_ManimCommunity/manim/animation/animation.py
"""Animate mobjects.""" from __future__ import annotations from manim.mobject.opengl.opengl_mobject import OpenGLMobject from .. import config, logger from ..constants import RendererType from ..mobject import mobject from ..mobject.mobject import Mobject from ..mobject.opengl import opengl_mobject from ..utils.rat...
manim_ManimCommunity/manim/animation/indication.py
"""Animations drawing attention to particular mobjects. Examples -------- .. manim:: Indications class Indications(Scene): def construct(self): indications = [ApplyWave,Circumscribe,Flash,FocusOn,Indicate,ShowPassingFlash,Wiggle] names = [Tex(i.__name__).scale(3) for i in indicati...
manim_ManimCommunity/manim/animation/updaters/__init__.py
"""Animations and utility mobjects related to update functions. Modules ======= .. autosummary:: :toctree: ../reference ~mobject_update_utils ~update """
manim_ManimCommunity/manim/animation/updaters/update.py
"""Animations that update mobjects.""" from __future__ import annotations __all__ = ["UpdateFromFunc", "UpdateFromAlphaFunc", "MaintainPositionRelativeTo"] import operator as op import typing from manim.animation.animation import Animation if typing.TYPE_CHECKING: from manim.mobject.mobject import Mobject c...
manim_ManimCommunity/manim/animation/updaters/mobject_update_utils.py
"""Utility functions for continuous animation of mobjects.""" from __future__ import annotations __all__ = [ "assert_is_mobject_method", "always", "f_always", "always_redraw", "always_shift", "always_rotate", "turn_animation_into_updater", "cycle_animation", ] import inspect from typ...
manim_ManimCommunity/tests/conftest.py
from __future__ import annotations import sys from pathlib import Path import pytest from manim import config, tempconfig def pytest_addoption(parser): parser.addoption( "--skip_slow", action="store_true", default=False, help="Will skip all the slow marked tests. Slow tests are ...
manim_ManimCommunity/tests/__init__.py