From b144c2708b39193fd614653a087eafe411a17828 Mon Sep 17 00:00:00 2001 From: abdallahsoliman00 Date: Wed, 9 Jul 2025 14:00:08 +0300 Subject: [PATCH 1/4] Added a shortcut for remove_all_except() in scene_embed --- manimlib/scene/scene_embed.py | 1 + 1 file changed, 1 insertion(+) diff --git a/manimlib/scene/scene_embed.py b/manimlib/scene/scene_embed.py index 429693dd55..7e3d7da110 100644 --- a/manimlib/scene/scene_embed.py +++ b/manimlib/scene/scene_embed.py @@ -66,6 +66,7 @@ def get_shortcuts(self): wait=scene.wait, add=scene.add, remove=scene.remove, + remove_all_except=scene.remove_all_except, clear=scene.clear, focus=scene.focus, save_state=scene.save_state, From cd4186add730a22ddc7b5aca9d434f9720c3b1bb Mon Sep 17 00:00:00 2001 From: abdallahsoliman00 Date: Fri, 11 Jul 2025 13:44:26 +0300 Subject: [PATCH 2/4] Added **kwargs argument to get_axis_label() and get_axis_labels() such that properties of the label like font size and t2c can be configured. --- manimlib/mobject/coordinate_systems.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/manimlib/mobject/coordinate_systems.py b/manimlib/mobject/coordinate_systems.py index bb8b5aa160..df0b2115ff 100644 --- a/manimlib/mobject/coordinate_systems.py +++ b/manimlib/mobject/coordinate_systems.py @@ -137,9 +137,10 @@ def get_axis_label( edge: Vect3, direction: Vect3, buff: float = MED_SMALL_BUFF, - ensure_on_screen: bool = False + ensure_on_screen: bool = False, + **kwargs ) -> Tex: - label = Tex(label_tex) + label = Tex(label_tex, **kwargs) label.next_to( axis.get_edge_center(edge), direction, buff=buff @@ -151,11 +152,12 @@ def get_axis_label( def get_axis_labels( self, x_label_tex: str = "x", - y_label_tex: str = "y" + y_label_tex: str = "y", + **kwargs ) -> VGroup: self.axis_labels = VGroup( - self.get_x_axis_label(x_label_tex), - self.get_y_axis_label(y_label_tex), + self.get_x_axis_label(x_label_tex, **kwargs), + self.get_y_axis_label(y_label_tex, **kwargs), ) return self.axis_labels From abc3d803ba6bfc1823ad2c1d1137d9ce09ae393d Mon Sep 17 00:00:00 2001 From: abdallahsoliman00 Date: Tue, 29 Jul 2025 01:30:23 +0300 Subject: [PATCH 3/4] Comments for set_color_by_rgba_func and set_color_by_rgb_func were ambiguous; clarified the comments. --- manimlib/mobject/mobject.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manimlib/mobject/mobject.py b/manimlib/mobject/mobject.py index 6fc99055f2..bcd403738d 100644 --- a/manimlib/mobject/mobject.py +++ b/manimlib/mobject/mobject.py @@ -1325,6 +1325,9 @@ def set_color_by_rgba_func( ) -> Self: """ Func should take in a point in R3 and output an rgba value + + **Note:** + func should accept an (N, 3) array and return an (N, 4) array of RGB values in [0,1] """ for mob in self.get_family(recurse): mob.set_rgba_array(func(mob.get_points())) @@ -1338,6 +1341,9 @@ def set_color_by_rgb_func( ) -> Self: """ Func should take in a point in R3 and output an rgb value + + **Note:** + func should accept an (N, 3) array and return an (N, 3) array of RGB values in [0,1] """ for mob in self.get_family(recurse): points = mob.get_points() From efb6585ae5db69157fae638403157dcb1f259fb1 Mon Sep 17 00:00:00 2001 From: abdallahsoliman00 Date: Tue, 29 Jul 2025 01:45:42 +0300 Subject: [PATCH 4/4] Changed the comment to remove the old description. The old description was valid up until pull request #2316. --- manimlib/mobject/mobject.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/manimlib/mobject/mobject.py b/manimlib/mobject/mobject.py index bcd403738d..4f7d2bc713 100644 --- a/manimlib/mobject/mobject.py +++ b/manimlib/mobject/mobject.py @@ -1324,10 +1324,7 @@ def set_color_by_rgba_func( recurse: bool = True ) -> Self: """ - Func should take in a point in R3 and output an rgba value - - **Note:** - func should accept an (N, 3) array and return an (N, 4) array of RGB values in [0,1] + Func should accept an (N, 3) array and return an (N, 4) array of RGB values in [0,1] """ for mob in self.get_family(recurse): mob.set_rgba_array(func(mob.get_points())) @@ -1340,10 +1337,7 @@ def set_color_by_rgb_func( recurse: bool = True ) -> Self: """ - Func should take in a point in R3 and output an rgb value - - **Note:** - func should accept an (N, 3) array and return an (N, 3) array of RGB values in [0,1] + Func should accept an (N, 3) array and return an (N, 3) array of RGB values in [0,1] """ for mob in self.get_family(recurse): points = mob.get_points()