Markable¶
- class manim_eng._base.markable.Markable(**kwargs: Any)¶
Bases:
VMobjectBase class for objects that can have marks attached.
- Parameters:
**kwargs (Any) – Keyword arguments to pass on to
manim.VMobject.
Attributes
Markable.animateUsed to animate the application of any method of
self.Markable.animation_overridesMarkable.colorMarkable.depthThe depth of the mobject.
Markable.fill_colorIf there are multiple colors (for gradient) this returns the first one
Markable.heightThe height of the mobject.
Markable.n_points_per_curveMarkable.sheen_factorMarkable.stroke_colorMarkable.widthThe width of the mobject.
- add(*mobjects: Mobject) Self¶
Add mobjects as submobjects.
The mobjects are added to
submobjects.Subclasses of mobject may implement
+and+=dunder methods.- Parameters:
mobjects – The mobjects to add.
- Returns:
self- Return type:
Mobject- Raises:
ValueError – When a mobject tries to add itself.
TypeError – When trying to add an object that is not an instance of
Mobject.
Notes
A mobject cannot contain itself, and it cannot contain a submobject more than once. If the parent mobject is displayed, the newly-added submobjects will also be displayed (i.e. they are automatically added to the parent Scene).
See also
Examples
>>> outer = Mobject() >>> inner = Mobject() >>> outer = outer.add(inner)
Duplicates are not added again:
>>> outer = outer.add(inner) >>> len(outer.submobjects) 1
Only Mobjects can be added:
>>> outer.add(3) Traceback (most recent call last): ... TypeError: Only values of type Mobject can be added as submobjects of Mobject, but the value 3 (at index 0) is of type int.
Adding an object to itself raises an error:
>>> outer.add(outer) Traceback (most recent call last): ... ValueError: Cannot add Mobject as a submobject of itself (at index 0).
A given mobject cannot be added as a submobject twice to some parent:
>>> parent = Mobject(name="parent") >>> child = Mobject(name="child") >>> parent.add(child, child) [...] WARNING ... parent >>> parent.submobjects [child]
- add_to_back(*mobjects: Mobject) Self¶
Add all passed mobjects to the back of the submobjects.
If
submobjectsalready contains the given mobjects, they just get moved to the back instead.- Parameters:
mobjects – The mobjects to add.
- Returns:
self- Return type:
Mobject
Note
Technically, this is done by adding (or moving) the mobjects to the head of
submobjects. The head of this list is rendered first, which places the corresponding mobjects behind the subsequent list members.- Raises:
ValueError – When a mobject tries to add itself.
TypeError – When trying to add an object that is not an instance of
Mobject.
Notes
A mobject cannot contain itself, and it cannot contain a submobject more than once. If the parent mobject is displayed, the newly-added submobjects will also be displayed (i.e. they are automatically added to the parent Scene).
- remove(*mobjects: Mobject) Self¶
Remove
submobjects.The mobjects are removed from
submobjects, if they exist.Subclasses of mobject may implement
-and-=dunder methods.- Parameters:
mobjects – The mobjects to remove.
- Returns:
self- Return type:
Mobject
See also
- rotate(*args: Any, **kwargs: Any) Self¶
Rotates the
Mobjectabout a certain point.