mirror of
https://github.com/3b1b/manim.git
synced 2025-07-29 13:03:31 +08:00
Remove check_data_alignment
This commit is contained in:
@ -1859,17 +1859,6 @@ class Mobject(object):
|
|||||||
result.append(shader_wrapper)
|
result.append(shader_wrapper)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def check_data_alignment(self, array: np.ndarray, data_key: str):
|
|
||||||
# Makes sure that self.data[key] can be broadcast into
|
|
||||||
# the given array, meaning its length has to be either 1
|
|
||||||
# or the length of the array
|
|
||||||
d_len = len(self.data[data_key])
|
|
||||||
if d_len != 1 and d_len != len(array):
|
|
||||||
self.data[data_key] = resize_with_interpolation(
|
|
||||||
self.data[data_key], len(array)
|
|
||||||
)
|
|
||||||
return self
|
|
||||||
|
|
||||||
def get_resized_shader_data_array(self, length: int) -> np.ndarray:
|
def get_resized_shader_data_array(self, length: int) -> np.ndarray:
|
||||||
# If possible, try to populate an existing array, rather
|
# If possible, try to populate an existing array, rather
|
||||||
# than recreating it each frame
|
# than recreating it each frame
|
||||||
@ -1885,7 +1874,6 @@ class Mobject(object):
|
|||||||
):
|
):
|
||||||
if data_key in self.locked_data_keys:
|
if data_key in self.locked_data_keys:
|
||||||
return
|
return
|
||||||
self.check_data_alignment(shader_data, data_key) # TODO, make sure this can be removed
|
|
||||||
shader_data[shader_data_key] = self.data[data_key]
|
shader_data[shader_data_key] = self.data[data_key]
|
||||||
|
|
||||||
def get_shader_data(self):
|
def get_shader_data(self):
|
||||||
|
Reference in New Issue
Block a user