mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Cleanup extract_mobject_family_members
This commit is contained in:
parent
eae7dbbe6e
commit
47636686cb
1 changed files with 6 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import itertools as it
|
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
@ -11,15 +10,14 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
def extract_mobject_family_members(
|
def extract_mobject_family_members(
|
||||||
mobject_list: Iterable[Mobject],
|
mobject_list: Iterable[Mobject],
|
||||||
only_those_with_points: bool = False
|
exclude_pointless: bool = False
|
||||||
) -> list[Mobject]:
|
) -> list[Mobject]:
|
||||||
result = list(it.chain(*[
|
return [
|
||||||
mob.get_family()
|
sm
|
||||||
for mob in mobject_list
|
for mob in mobject_list
|
||||||
]))
|
for sm in mob.get_family()
|
||||||
if only_those_with_points:
|
if (not exclude_pointless) or sm.has_points()
|
||||||
result = [mob for mob in result if mob.has_points()]
|
]
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def restructure_list_to_exclude_certain_family_members(
|
def restructure_list_to_exclude_certain_family_members(
|
||||||
|
|
Loading…
Add table
Reference in a new issue