From e5eed7c36a23c0e23f5c4a44ab859a1c54d0c256 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 2 Feb 2023 13:28:06 -0800 Subject: [PATCH] Batch render groups by Mobject type --- manimlib/scene/scene.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.py index 51694c5d..0a764737 100644 --- a/manimlib/scene/scene.py +++ b/manimlib/scene/scene.py @@ -383,20 +383,11 @@ class Scene(object): def assemble_render_groups(self): """ - Rendering is more efficient when VMobjects are grouped - together, so this function creates VGroups of all - clusters of adjacent VMobjects in the scene's mobject - list. + Rendering can be more efficient when mobjects of the + same type are grouped together, so this function creates + Groups of all clusters of adjacent Mobjects in the scene """ - batches = batch_by_property( - self.mobjects, - lambda m: "|".join([ - str(m.shader_dtype.names), - str(m.is_fixed_in_frame()), - str(m.depth_test), - str(m.is_changing()), - ]) - ) + batches = batch_by_property(self.mobjects, lambda m: str(type(m))) for group in self.render_groups: group.clear()