Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from 3b1b:master #3

Open
wants to merge 1,910 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
1910 commits
Select commit Hold shift + click to select a range
57deab6
Fix ControlsExample
3b1b Jan 31, 2023
0645912
Merge pull request #1979 from 3b1b/video-work
3b1b Jan 31, 2023
f2d71e6
Don't rotate Laptop into place
3b1b Jan 31, 2023
5952f9e
Make sure rgbas will be resized if bigger than Mobject.data
3b1b Jan 31, 2023
2cbad30
Change VMobject rendering mode to TRIANGLES
3b1b Jan 31, 2023
9e5fca6
Merge branch 'type-error-fix' into video-work
3b1b Jan 31, 2023
2d0bdfb
Merge branch 'glitch-fix' into video-work
3b1b Jan 31, 2023
424db4b
Ensure view matrix is not computed more than it needs to be
3b1b Jan 31, 2023
92e4d43
Make sure camera location is not computed more times than it needs to be
3b1b Jan 31, 2023
60aae74
Make sure animations will trigger a refresh for joint products
3b1b Jan 31, 2023
a4d9b10
Whoops, make sure deepcopy actually returns
3b1b Jan 31, 2023
50343e9
Add Self type to mobject.py
3b1b Jan 31, 2023
b58224f
Add Self type to vectorized_mobject.py
3b1b Jan 31, 2023
3779577
Add Self type to surface.py
3b1b Jan 31, 2023
af585ca
Add Self type to dot_cloud.py and point_cloud_mobject.py
3b1b Jan 31, 2023
d8c21ff
Add Self type to changing.py
3b1b Jan 31, 2023
da6875c
Add Self type to coordinate_systems.py
3b1b Jan 31, 2023
6a42ef8
Add Self type to geometry.py
3b1b Jan 31, 2023
74a11bb
Add Self type to matrix.py
3b1b Jan 31, 2023
576d8c9
Add Self type to numbers.py
3b1b Jan 31, 2023
0452012
Add Self type to shape_matchers.py
3b1b Jan 31, 2023
031adda
Small fixes to three_dimensions.py
3b1b Jan 31, 2023
468fdf9
Add Self type to value_tracker.py
3b1b Jan 31, 2023
015a748
Remove stray import
3b1b Jan 31, 2023
e8302e6
Merge pull request #1978 from 3b1b/type-error-fix
3b1b Jan 31, 2023
9dc6cce
Merge branch 'master' into glitch-fix
3b1b Jan 31, 2023
8e8229b
Merge pull request #1980 from 3b1b/glitch-fix
3b1b Jan 31, 2023
3e308d8
Merge branch 'master' of github.com:3b1b/manim into video-work
3b1b Jan 31, 2023
4c327cd
Merge branch 'add-self-type' into video-work
3b1b Jan 31, 2023
1e46847
Use Iterator type for Mobject.__iter__
3b1b Jan 31, 2023
7e78e76
Only call become at the end of Transform if the rate func ends at 1
3b1b Jan 31, 2023
077f264
In Mobject.become, match needs_new_bounding_box status
3b1b Jan 31, 2023
f42b3bf
In UpdatersExample, use Tex.make_number_changable
3b1b Jan 31, 2023
3b0c958
Check case of scale = 0 in get_view_matrix
3b1b Jan 31, 2023
93e65fa
Prevent needless extra copying in Mobject.copy
3b1b Jan 31, 2023
d9c85aa
Add dict_eq
3b1b Jan 31, 2023
fca5770
Fix Camera.blit
3b1b Feb 1, 2023
d3a4d81
Remove commended code
3b1b Feb 1, 2023
f858a43
Make alignment between VMobjects conducive to smoother interpolation
3b1b Feb 1, 2023
c8d1ee5
No longer any need for specialized invisible_copy
3b1b Feb 1, 2023
bc38165
Allow for matched_pairs arg to TransformMatchingStrings
3b1b Feb 1, 2023
7c08783
Change backstroke defaults in OpeningScene
3b1b Feb 1, 2023
b1fb3e1
Add render mode and early discard for fill canvas vao
3b1b Feb 1, 2023
0c9afb6
Small clean up to render calls
3b1b Feb 1, 2023
04733ac
Default to fully opaque background rectangle
3b1b Feb 1, 2023
b351c9f
Add smaller h_buff to matrix in OpeningManimExample
3b1b Feb 1, 2023
280090a
Small reorganization to VMobject.get_shader_wrapper_list, and default…
3b1b Feb 1, 2023
5527c07
Merge pull request #1981 from 3b1b/add-self-type
3b1b Feb 1, 2023
e76c64a
Merge branch 'master' into video-work
3b1b Feb 1, 2023
c8b65d5
Merge pull request #1982 from 3b1b/video-work
3b1b Feb 1, 2023
c062592
Draw border width behind fill
3b1b Feb 1, 2023
9ef14c7
Change default h_buff on Matrix
3b1b Feb 1, 2023
979589a
Change clicking behavior in InteractiveScene
3b1b Feb 1, 2023
40bcb7e
Accept list of Vect3 as an input to Mobject.set_points
3b1b Feb 1, 2023
f293ccd
Add copy_frame_anim_call
3b1b Feb 1, 2023
f83c441
Make it so that copying a mobject will copy its name, if applicable
3b1b Feb 1, 2023
8820af6
Check that scene has a camera frame in pixel_to_point_coords
3b1b Feb 2, 2023
f4a6f99
Check _use_winding_fill on the submobject level
3b1b Feb 2, 2023
ebf2ee5
Update tex patterns
3b1b Feb 2, 2023
6eafdc6
Merge branch 'video-work' into render-groups
3b1b Feb 2, 2023
8adf2a6
Partition render groups based on shader type, fixed_in_frame status, …
3b1b Feb 2, 2023
eeadbe4
Small reshuffling
3b1b Feb 2, 2023
47672d3
Add checks for setting submobjects with existing list
3b1b Feb 2, 2023
9c03a40
Account for unnecessary calls to use_winding_fill
3b1b Feb 2, 2023
b499caa
Have SVG subdivide intersections if winding fill is not a default
3b1b Feb 2, 2023
17cef42
Update fill shader alpha blending, and simplify the fill canvas
3b1b Feb 2, 2023
ab6a7df
Use typing_extensions to import Self for python versions <3.11
3b1b Feb 2, 2023
260815c
Merge pull request #1984 from 3b1b/safer-self
3b1b Feb 2, 2023
4ec2e8b
Merge branch 'master' of github.com:3b1b/manim into video-work
3b1b Feb 2, 2023
594b925
Account for unnecessary calls to use_winding_fill
3b1b Feb 2, 2023
0cf9a35
Have SVG subdivide intersections if winding fill is not a default
3b1b Feb 2, 2023
c3823e7
Update fill shader alpha blending, and simplify the fill canvas
3b1b Feb 2, 2023
7476740
Merge pull request #1985 from 3b1b/cleaner-winding-fill
3b1b Feb 2, 2023
a1b9eae
Merge branch 'master' of github.com:3b1b/manim into video-work
3b1b Feb 2, 2023
acb4b1c
Finalize color at the vertex level, rather than the fragment level, f…
3b1b Feb 2, 2023
e5eed7c
Batch render groups by Mobject type
3b1b Feb 2, 2023
b9d6dcd
Save _has_fill and _has_stroke to prevent unnecessary recalculation
3b1b Feb 2, 2023
bd89056
Only recalculate outer_vert_indices when points are resized
3b1b Feb 2, 2023
63dbe3b
More direct check for family_members_with_points
3b1b Feb 2, 2023
3c0d682
Change clicking behavior in InteractiveScene
3b1b Feb 1, 2023
d0c6d4d
Accept list of Vect3 as an input to Mobject.set_points
3b1b Feb 1, 2023
b9d37a9
Add copy_frame_anim_call
3b1b Feb 1, 2023
9cadfa1
Make it so that copying a mobject will copy its name, if applicable
3b1b Feb 1, 2023
be60293
Check that scene has a camera frame in pixel_to_point_coords
3b1b Feb 2, 2023
4e674e5
Merge pull request #1987 from 3b1b/interactive-scene-update
3b1b Feb 2, 2023
6f2cbc4
Merge branch 'master' of github.com:3b1b/manim into video-work
3b1b Feb 2, 2023
d263fa2
Merge pull request #1986 from 3b1b/video-work
3b1b Feb 2, 2023
0e60b12
Only compute const_data_keys for unlocked data
3b1b Feb 2, 2023
c4d698a
Have Transform only copy target_mobject if it must
3b1b Feb 2, 2023
e36719a
Use resize_points in Mobject.set_data
3b1b Feb 2, 2023
ad2e714
Lock uniform keys, the same way data keys are
3b1b Feb 3, 2023
1dcc678
Make sure animating a VGroup uniforms will have an effect
3b1b Feb 3, 2023
fbcbbc9
Merge pull request #1988 from 3b1b/video-work
3b1b Feb 3, 2023
7f940fb
Change how ShaderWrapper uniforms are handled
3b1b Feb 3, 2023
009f9dd
Don't call become at the end of Transform
3b1b Feb 3, 2023
4629e08
Ensure joint_products are computed at both the start and end of an an…
3b1b Feb 3, 2023
3d0fe27
Simplify VMobject.set_rgba_array
3b1b Feb 3, 2023
88959df
Use set_color instead of set_rgba_array in vector_field
3b1b Feb 3, 2023
d10745a
Have CameraFrame.get_view_matrix and and CameraFrame.get_implied_came…
3b1b Feb 3, 2023
c477701
FIx Mobject.replace_shader_code
3b1b Feb 3, 2023
ee08c55
Remove ShaderWrapper.get_program_id
3b1b Feb 3, 2023
772ea79
Add check for null VMobject in shader init
3b1b Feb 3, 2023
ac3db9b
Add set_program_uniform function
3b1b Feb 3, 2023
7c561d3
Edit set_program_uniform
3b1b Feb 3, 2023
b25f022
Make it an option (default to false) to prerun a scene to calculate i…
3b1b Feb 3, 2023
bc10778
Clean up get_scenes_to_render
3b1b Feb 3, 2023
12dc124
Revert to simple progress_description_len default
3b1b Feb 3, 2023
e1bb360
Add CLI args for setting video codec and pixel forma
3b1b Feb 3, 2023
a54d1ed
Set default pixel format to yuv420p
3b1b Feb 3, 2023
b8fe7b0
Note that restoring state affects the mobject list
3b1b Feb 4, 2023
fab917c
Improve TransformMatchingString to match longest common substrings by…
3b1b Feb 4, 2023
3bf9e40
Add more lenient tolerance to Mobject.has_same_shape_as
3b1b Feb 4, 2023
e3b9527
Update TexTransformExample, and pull out TexIndexing
3b1b Feb 4, 2023
c918e84
Change default progress bar format
3b1b Feb 4, 2023
7d1330f
Check if mobject_uniforms is None
3b1b Feb 5, 2023
4e90a77
Change type hint on LaggedStart to accept any functions outputting an…
3b1b Feb 5, 2023
d1b1df6
Ensure Window's scene always points back to window
3b1b Feb 5, 2023
66b78d0
Merge pull request #1989 from 3b1b/video-work
3b1b Feb 5, 2023
1844f7f
Fix for https://github.com/3b1b/manim/issues/1991
3b1b Feb 8, 2023
41f0239
Merge pull request #1992 from 3b1b/bug-fix
3b1b Feb 8, 2023
0ce9729
Remove num_axis_pieces arg from ThreeDAxes
3b1b Feb 9, 2023
169e7a3
Give ThreeDAxes flat stroke by default
3b1b Feb 9, 2023
f2c07af
add 'return self'
3b1b Feb 9, 2023
ded06c1
Give SceneFileWriter an option for saturation, and set default to 1.7
3b1b Feb 9, 2023
3e3e4de
Add option for gamma correction to SceneFileWriter
3b1b Feb 9, 2023
b39fbb6
Ensure joint_products are refreshed for _AnimationBuilder
3b1b Feb 9, 2023
ad40999
Small tweak
3b1b Feb 9, 2023
01c51db
animation.update_config -> animation.update_rate_info
3b1b Feb 9, 2023
557cb66
Fix transparent background videos
3b1b Feb 15, 2023
d842858
Merge pull request #1994 from 3b1b/video-work
3b1b Feb 15, 2023
576a264
Use quick_point_from_proportion in MoveAlongPath
3b1b Feb 16, 2023
dcb58c1
Remove arg_creator arg from LaggedStartMap
3b1b Feb 16, 2023
3a05352
Add poly_line_length function
3b1b Feb 16, 2023
c372ef4
Faster VMobject.get_arc_length
3b1b Feb 16, 2023
3f2d159
Make TrueDot shading in 3d work
3b1b Feb 17, 2023
a79d4a8
Keep track of dots in DieFace
3b1b Feb 24, 2023
1eb8193
Fix issue with ticks going beyond number line
3b1b Feb 24, 2023
b216b8f
Reset default in set_style to stroke_background = False
3b1b Feb 24, 2023
6d0b586
Prevent index out of range error for ShowSubmobjectsOneByOne
3b1b Mar 10, 2023
392019f
Specify type in bind_to_graph
3b1b Mar 10, 2023
b644bb5
Update submobjects before parents
3b1b Mar 10, 2023
d1e2a7a
Make sure \text{...} is counted correctly in num_tex_symbols
3b1b Mar 10, 2023
80fb1a9
Add \text to TEX_TO_SYMBOL_COUNT
3b1b Mar 10, 2023
0d41503
Ensure exact integers are displays for large values in Integer
3b1b Mar 14, 2023
6b24860
Tweak default configuration for Underline
3b1b Mar 14, 2023
de8e9e5
Fix error with setting bubble direction
3b1b Mar 14, 2023
71ab276
Update installation.rst added FFmpeg install
rudransh61 May 26, 2023
f33b8d1
Add stretch_factor in FlashUnder Underline
3b1b Jun 10, 2023
5d9a7f4
Add taper_width argument to FlashAround
3b1b Jun 10, 2023
16f5890
Add CoordianteSystem.get_area_under_graph
3b1b Jun 10, 2023
ce7422f
Add ThreeDAxes.get_graph and .get_parametric_surface
3b1b Jun 10, 2023
fa1080d
Be sure reverse_points changes data in place
3b1b Jun 10, 2023
f01b990
Add default Mobject.match_style
3b1b Jun 10, 2023
63f6e9d
Add Dartboard
3b1b Jun 10, 2023
bae3b98
Fixes to Surface
3b1b Jun 10, 2023
6f8ea74
Small formatting tweaks
3b1b Jun 10, 2023
3e64111
Change default on VMobject to no depth test
3b1b Jun 10, 2023
cb02066
Add always_depth_test option to ThreeDScene, default to true
3b1b Jun 10, 2023
162fd4a
Change defaults for where videos are saved
3b1b Jun 10, 2023
0609c1b
Change default saturation and gamma to each be 1
3b1b Jun 10, 2023
21d2054
Add texture_names_to_ids to ShaderWrapper
3b1b Jun 10, 2023
4f42ebe
Small formatting tweaks
3b1b Jun 10, 2023
7ff45b4
Having changing decimal match fixed_in_frame status
3b1b Jun 23, 2023
7954ba1
Use rate_function appropriately in ShowIncreasingSubsets
3b1b Aug 16, 2023
2337be2
Remove num_sampled_graph_points_per_tick in Axes __init__
3b1b Aug 16, 2023
ddf2f7d
Fix typo
3b1b Aug 16, 2023
fc522e5
Change width_to_tip_len -> tip_len_to_width
3b1b Aug 16, 2023
d21b05a
Arrow fix
3b1b Aug 16, 2023
4be7f61
Fix issues with stroke opacities passed as numpy arrays
3b1b Aug 16, 2023
f2ad9a7
Small format fix
3b1b Aug 16, 2023
eafd095
Handle make_jagged for empty VMobjects
3b1b Aug 16, 2023
c8cf83e
Add cartesian_product
3b1b Aug 16, 2023
13d4ab1
Stylistic change
3b1b Aug 16, 2023
fa798a2
Add \dots and \mathds to tex_to_symbol_count
3b1b Aug 16, 2023
87e4a71
Add surround method for Rectangles and SurroundingRectangles
3b1b Sep 4, 2023
0a64213
Add scale_radii method for DotCloud
3b1b Sep 4, 2023
60a4f0e
Factor out Arc.create_quadratic_bezier_points to quadratic_bezier_poi…
3b1b Sep 4, 2023
690eb24
Add VMobject.add_arc_to method
3b1b Sep 4, 2023
5f41e23
Improve VMobject.add_arc_to
3b1b Sep 5, 2023
b53ab02
Simplify initialization of Line with path arc
3b1b Sep 5, 2023
2b00a9c
Fix add_curve_to
3b1b Sep 5, 2023
295a0f7
Formatting tweak
3b1b Sep 5, 2023
39e5d24
Factor out partial results from point_from_proportion
3b1b Sep 5, 2023
a8b1791
Small tweaks to arrow tip implementation
3b1b Sep 5, 2023
916ab94
Remove white space
3b1b Oct 9, 2023
f4778b5
Have Animation keep track of whether a mobject had had it's updating …
3b1b Nov 6, 2023
cbc3246
Note chanted stroke and fill after DrawBorderThenFill has complete
3b1b Nov 6, 2023
0d046a7
Add an option for a graph to continually update to its defining function
3b1b Nov 6, 2023
2cdb85c
Don't assign a fixed default depth to ThreeDAxes
3b1b Nov 6, 2023
17cd597
Have Arrow track what stroke width it was set to
3b1b Nov 6, 2023
246a010
Add default border width to StringMobject
3b1b Nov 6, 2023
8a4d7b4
Add a small hack to ensure Window resets properly in non-primary moni…
3b1b Nov 6, 2023
dcf3eb8
Ignore pyright configuration
3b1b Nov 6, 2023
f8fedff
Use rate function on MoveAlongPath
3b1b Dec 3, 2023
9ba684d
Merge pull request #2028 from rudransh61/master
3b1b Jan 1, 2024
88672a2
Include texture id in shader wrapper id
3b1b Jan 17, 2024
41ece95
Explicitly call out global naure of ID_TO_TEXTURE map
3b1b Jan 17, 2024
2c11079
Merge pull request #2094 from 3b1b/video-work
3b1b Jan 17, 2024
855ef9b
Refactor Matrix, DecimalMatrix, MobjectMatrix, etc.
3b1b Jan 18, 2024
8179ba8
Reformat defaults for n_rows and n_cols in Mobject.arrange_in_grid
3b1b Jan 18, 2024
60b762c
Remove redundant and unused get_gl_Position.glsl file
3b1b Jan 19, 2024
d3dee24
Allow for smooth transitions between mobjects fixed and unfixed from …
3b1b Jan 19, 2024
1c72059
Have surrounding rectangle match framed fixed status of what it surro…
3b1b Jan 19, 2024
cde709f
Replace fix_in_frame matching for DecimalNumber.set_value to general …
3b1b Jan 19, 2024
711438f
Update the types in decorator methods using @wraps
3b1b Feb 4, 2024
45d9049
Minor clean up
3b1b Feb 4, 2024
661814d
Add all orientation options into CameraFrame.reorient
3b1b Feb 4, 2024
4aef0d1
Add add_ambient_rotation
3b1b Feb 4, 2024
ebe689d
Treat is_fixed_in_frame as a float in uniforms, to allow for transfor…
3b1b Feb 4, 2024
dfa96c2
Update copy_frame_positioning
3b1b Feb 4, 2024
7009f0f
Add space after assert
3b1b Feb 4, 2024
100b108
Treat Group and VGroup more like list types
3b1b Feb 5, 2024
31b2bcd
Add interpolate_color_by_hsl
3b1b Feb 8, 2024
e4c824e
Update random_bright_color to operate based on hsl ranges
3b1b Feb 8, 2024
f3571cf
Add random import
3b1b Feb 8, 2024
8417369
Performance improvement for DecimalNumber.set_value
3b1b Feb 8, 2024
2966f35
Pull type definitions used for Generic[SubmobjectType] outside of if …
3b1b Feb 8, 2024
45f8ca7
Specify output type for DecimalMatrix.element_to_mobject
3b1b Feb 8, 2024
c531e56
Fix DecimalNumber.set_value font size issue
3b1b Feb 8, 2024
5784275
Add defaults for Matrix object to have ellipses
3b1b Feb 9, 2024
d44e248
Specify type of argument in Mobject.add
3b1b Feb 9, 2024
4ce8a3b
Fix computation of normals for Surface
3b1b Feb 13, 2024
ed3ac74
Add option to change Euler axes
3b1b Feb 13, 2024
7b577e9
Have matrix keep track of elements and ellipses as lists instead of V…
3b1b Feb 13, 2024
5632fee
Ensure get_opacity returns float
3b1b Feb 21, 2024
712fa30
Ensure Brace.get_tex uses buff key word arg
3b1b Feb 21, 2024
4a89376
Add method for resetting which plane in 3d space behaves like the flo…
3b1b Feb 21, 2024
e784c42
Add big_tick_spacing option NumberLine
3b1b Feb 22, 2024
7edc4b6
Replace numbers_with_elongated_ticks -> big_tick_numbers
3b1b Feb 22, 2024
ffbe5c8
Add type hints for affects_mobject_list
3b1b Mar 2, 2024
9432a73
Let checkpoint_paste work on methods of the current scene
3b1b Mar 2, 2024
2e9c895
Restrict alpha in CountInFrom
3b1b Mar 7, 2024
a5f2ac6
Spacing
3b1b Mar 7, 2024
4d67361
Add shuffled
3b1b Mar 7, 2024
1372cf1
Allow VGroup and Group to accept generators and iterables as arguments
3b1b Mar 7, 2024
2380ffd
Allow LaggedStart to accept an iterable as an argument
3b1b Mar 7, 2024
a6b46c6
Add Mobject.always and Mobject.f_always
3b1b Mar 7, 2024
3c778ba
Add comment to Mobject.animate
3b1b Mar 7, 2024
e124aec
Clarify Mobject.needs_new_bounding_box is private
3b1b Mar 7, 2024
4b14c11
Only reconstruct family as needed
3b1b Mar 7, 2024
fd35433
Change name note_updated_family -> note_changed_family
3b1b Mar 7, 2024
70b839e
Change to only compute has_updater status as needed
3b1b Mar 7, 2024
83cd5d6
Clean up updater matters, prune unused functions
3b1b Mar 7, 2024
d3ba101
Change from tracking time_based_updater and non_time_updater lists se…
3b1b Mar 7, 2024
226d649
Change UpdatersExample scene to feature .always and .f_always syntax
3b1b Mar 7, 2024
4729e44
Merge pull request #2106 from 3b1b/video-work
3b1b Mar 7, 2024
8235607
remove include_background_rectangle
Mar 11, 2024
c970f77
Removed old argument from example
pdancstep May 3, 2024
3c374c3
Merge pull request #2108 from kubanemil/integer_matrix
3b1b May 3, 2024
88c7e9d
Merge pull request #2132 from pdancstep/example-correction
3b1b May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only reconstruct family as needed
  • Loading branch information
3b1b committed Mar 7, 2024
commit 4b14c11e4b2b97c7436dfe3f8823a700062985cb
43 changes: 23 additions & 20 deletions manimlib/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(
# Internal state
self.submobjects: list[Mobject] = []
self.parents: list[Mobject] = []
self.family: list[Mobject] = [self]
self.family: list[Mobject] | None = [self]
self.locked_data_keys: set[str] = set()
self.const_data_keys: set[str] = set()
self.locked_uniform_keys: set[str] = set()
Expand Down Expand Up @@ -409,23 +409,26 @@ def split(self) -> list[Self]:
return self.submobjects

@affects_data
def assemble_family(self) -> Self:
sub_families = (sm.get_family() for sm in self.submobjects)
self.family = [self, *it.chain(*sub_families)]
self.refresh_has_updater_status()
self.refresh_bounding_box()
def note_updated_family(self, only_changed_order=False) -> Self:
self.family = None
if not only_changed_order:
self.refresh_has_updater_status()
self.refresh_bounding_box()
for parent in self.parents:
parent.assemble_family()
parent.note_updated_family()
return self

def get_family(self, recurse: bool = True) -> list[Mobject]:
if recurse:
return self.family
else:
if not recurse:
return [self]
if self.family is None:
# Reconstruct and save
sub_families = (sm.get_family() for sm in self.submobjects)
self.family = [self, *it.chain(*sub_families)]
return self.family

def family_members_with_points(self) -> list[Self]:
return [m for m in self.family if len(m.data) > 0]
def family_members_with_points(self) -> list[Mobject]:
return [m for m in self.get_family() if len(m.data) > 0]

def get_ancestors(self, extended: bool = False) -> list[Mobject]:
"""
Expand Down Expand Up @@ -456,7 +459,7 @@ def add(self, *mobjects: Mobject) -> Self:
self.submobjects.append(mobject)
if self not in mobject.parents:
mobject.parents.append(self)
self.assemble_family()
self.note_updated_family()
return self

def remove(
Expand All @@ -472,7 +475,7 @@ def remove(
if parent in child.parents:
child.parents.remove(parent)
if reassemble:
parent.assemble_family()
parent.note_updated_family()
return self

def clear(self) -> Self:
Expand All @@ -489,12 +492,12 @@ def replace_submobject(self, index: int, new_submob: Mobject) -> Self:
old_submob.parents.remove(self)
self.submobjects[index] = new_submob
new_submob.parents.append(self)
self.assemble_family()
self.note_updated_family()
return self

def insert_submobject(self, index: int, new_submob: Mobject) -> Self:
self.submobjects.insert(index, new_submob)
self.assemble_family()
self.note_updated_family()
return self

def set_submobjects(self, submobject_list: list[Mobject]) -> Self:
Expand Down Expand Up @@ -606,20 +609,20 @@ def sort(
self.submobjects.sort(key=submob_func)
else:
self.submobjects.sort(key=lambda m: point_to_num_func(m.get_center()))
self.assemble_family()
self.note_updated_family(only_changed_order=True)
return self

def shuffle(self, recurse: bool = False) -> Self:
if recurse:
for submob in self.submobjects:
submob.shuffle(recurse=True)
random.shuffle(self.submobjects)
self.assemble_family()
self.note_updated_family(only_changed_order=True)
return self

def reverse_submobjects(self) -> Self:
self.submobjects.reverse()
self.assemble_family()
self.note_updated_family(only_changed_order=True)
return self

# Copying and serialization
Expand Down Expand Up @@ -692,7 +695,7 @@ def copy(self, deep: bool = False) -> Self:
for attr, value in self.__dict__.items():
if isinstance(value, Mobject) and value is not self:
if value in family:
setattr(result, attr, result.family[self.family.index(value)])
setattr(result, attr, result.family[family.index(value)])
elif isinstance(value, np.ndarray):
setattr(result, attr, value.copy())
return result
Expand Down