From 1738876f4395e735908b11ef464fee703e207301 Mon Sep 17 00:00:00 2001 From: MathItYT Date: Sun, 27 Oct 2024 14:06:35 -0300 Subject: [PATCH] fix bad 3D overlapping using z_index --- manimlib/scene/scene.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.py index eb5e9d35..65ab4949 100644 --- a/manimlib/scene/scene.py +++ b/manimlib/scene/scene.py @@ -373,8 +373,8 @@ class Scene(object): Groups of all clusters of adjacent Mobjects in the scene """ batches = batch_by_property( - self.mobjects, - lambda m: str(type(m)) + str(m.get_shader_wrapper(self.camera.ctx).get_id()) + sorted(self.mobjects, key=lambda m: m.z_index), + lambda m: str(type(m)) + str(m.get_shader_wrapper(self.camera.ctx).get_id()) + str(m.z_index) ) for group in self.render_groups: