2022-02-12 23:47:23 +08:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2022-02-14 21:34:56 +08:00
|
|
|
from typing import TYPE_CHECKING
|
2022-02-16 21:08:25 +08:00
|
|
|
|
2022-02-14 21:34:56 +08:00
|
|
|
if TYPE_CHECKING:
|
2022-04-12 19:19:59 +08:00
|
|
|
from typing import Iterable
|
|
|
|
|
2022-02-14 21:34:56 +08:00
|
|
|
from manimlib.mobject.mobject import Mobject
|
2020-01-15 18:30:58 -08:00
|
|
|
|
|
|
|
|
2022-02-12 23:47:23 +08:00
|
|
|
def extract_mobject_family_members(
|
|
|
|
mobject_list: Iterable[Mobject],
|
2022-04-20 21:51:56 -07:00
|
|
|
exclude_pointless: bool = False
|
2022-02-12 23:47:23 +08:00
|
|
|
) -> list[Mobject]:
|
2022-04-20 21:51:56 -07:00
|
|
|
return [
|
|
|
|
sm
|
2020-02-14 15:29:35 -08:00
|
|
|
for mob in mobject_list
|
2022-04-20 21:51:56 -07:00
|
|
|
for sm in mob.get_family()
|
|
|
|
if (not exclude_pointless) or sm.has_points()
|
|
|
|
]
|