diff --git a/manimlib/camera/camera.py b/manimlib/camera/camera.py index 4dfc994c..3dbab48d 100644 --- a/manimlib/camera/camera.py +++ b/manimlib/camera/camera.py @@ -415,7 +415,7 @@ class Camera(object): if indices is None: ibo = None elif single_use: - ibo = self.ctx.buffer(indices) + ibo = self.ctx.buffer(indices.astype(np.uint32)) else: # The vao.render call is strangely longer # when an index buffer is used, so if the diff --git a/manimlib/mobject/mobject.py b/manimlib/mobject/mobject.py index e33c1a7f..300a279e 100644 --- a/manimlib/mobject/mobject.py +++ b/manimlib/mobject/mobject.py @@ -238,7 +238,7 @@ class Mobject(object): self.resize_points(0) def get_num_points(self) -> int: - return len(self.data["points"]) + return len(self.get_points()) def get_all_points(self) -> Vect3Array: if self.submobjects: @@ -247,7 +247,7 @@ class Mobject(object): return self.get_points() def has_points(self) -> bool: - return self.data["points"].size > 0 + return len(self.get_points()) > 0 def get_bounding_box(self) -> Vect3Array: if self.needs_new_bounding_box: diff --git a/manimlib/mobject/numbers.py b/manimlib/mobject/numbers.py index 7effabea..b0128868 100644 --- a/manimlib/mobject/numbers.py +++ b/manimlib/mobject/numbers.py @@ -111,12 +111,12 @@ class DecimalNumber(VMobject): num_string = num_string.replace("-", "–") return num_string - def init_data(self) -> None: - super().init_data() - self.data["font_size"] = np.array([self.font_size], dtype=float) + def init_uniforms(self) -> None: + super().init_uniforms() + self.uniforms["font_size"] = self.font_size def get_font_size(self) -> int: - return int(self.data["font_size"][0]) + return int(self.uniforms["font_size"]) def get_formatter(self, **kwargs) -> str: """ @@ -167,7 +167,7 @@ class DecimalNumber(VMobject): return self def _handle_scale_side_effects(self, scale_factor: float) -> None: - self.data["font_size"] *= scale_factor + self.uniforms["font_size"] *= scale_factor def get_value(self) -> float | complex: return self.number diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index 52c7692a..4ad9cdec 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -720,7 +720,7 @@ class VMobject(Mobject): return bezier(self.get_nth_curve_points(n)) def get_num_curves(self) -> int: - return len(self.data["points"]) // 2 + return self.get_num_points() // 2 def quick_point_from_proportion(self, alpha: float) -> Vect3: # Assumes all curves have the same length, so is inaccurate