TransformMatchingAbstractBase#
Qualified name: manim.animation.transform\_matching\_parts.TransformMatchingAbstractBase
- class TransformMatchingAbstractBase(mobject=None, *args, use_override=True, **kwargs)[source]#
Bases:
AnimationGroup
Abstract base class for transformations that keep track of matching parts.
Subclasses have to implement the two static methods
get_mobject_parts()
andget_mobject_key()
.Basically, this transformation first maps all submobjects returned by the
get_mobject_parts
method to certain keys by applying theget_mobject_key
method. Then, submobjects with matching keys are transformed into each other.- Parameters
mobject – The starting
Mobject
.target_mobject – The target
Mobject
.transform_mismatches – Controls whether submobjects without a matching key are transformed into each other by using
Transform
. Default:False
.fade_transform_mismatches – Controls whether submobjects without a matching key are transformed into each other by using
FadeTransform
. Default:False
.key_map – Optional. A dictionary mapping keys belonging to some of the starting mobject’s submobjects (i.e., the return values of the
get_mobject_key
method) to some keys belonging to the target mobject’s submobjects that should be transformed although the keys don’t match.kwargs – All further keyword arguments are passed to the submobject transformations.
Note
If neither
transform_mismatches
norfade_transform_mismatches
are set toTrue
, submobjects without matching keys in the starting mobject are faded out in the direction of the unmatched submobjects in the target mobject, and unmatched submobjects in the target mobject are faded in from the direction of the unmatched submobjects in the start mobject.Methods
Clean up the
Scene
after finishing the animation.get_mobject_key
get_mobject_parts
get_shape_map