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
|
||||
|
||||
import itertools as it
|
||||
from typing import Iterable
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
@ -11,15 +10,14 @@ if TYPE_CHECKING:
|
|||
|
||||
def extract_mobject_family_members(
|
||||
mobject_list: Iterable[Mobject],
|
||||
only_those_with_points: bool = False
|
||||
exclude_pointless: bool = False
|
||||
) -> list[Mobject]:
|
||||
result = list(it.chain(*[
|
||||
mob.get_family()
|
||||
return [
|
||||
sm
|
||||
for mob in mobject_list
|
||||
]))
|
||||
if only_those_with_points:
|
||||
result = [mob for mob in result if mob.has_points()]
|
||||
return result
|
||||
for sm in mob.get_family()
|
||||
if (not exclude_pointless) or sm.has_points()
|
||||
]
|
||||
|
||||
|
||||
def restructure_list_to_exclude_certain_family_members(
|
||||
|
|
Loading…
Add table
Reference in a new issue