mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Small renaming
This commit is contained in:
parent
5a95bfa70f
commit
74b42a6eb5
1 changed files with 8 additions and 8 deletions
|
@ -146,26 +146,26 @@ class ShaderWrapper(object):
|
||||||
|
|
||||||
def read_in(
|
def read_in(
|
||||||
self,
|
self,
|
||||||
vert_data_list: List[np.ndarray],
|
data_list: List[np.ndarray],
|
||||||
vert_indices_list: List[np.ndarray] | None = None
|
indices_list: List[np.ndarray] | None = None
|
||||||
) -> ShaderWrapper:
|
) -> ShaderWrapper:
|
||||||
# Assume all are of the same type
|
# Assume all are of the same type
|
||||||
total_len = sum(len(data) for data in vert_data_list)
|
total_len = sum(len(data) for data in data_list)
|
||||||
self.vert_data = resize_array(self.vert_data, total_len)
|
self.vert_data = resize_array(self.vert_data, total_len)
|
||||||
if total_len == 0:
|
if total_len == 0:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
if vert_indices_list is not None and self.vert_indices is not None:
|
if indices_list is not None and self.vert_indices is not None:
|
||||||
total_verts = sum(len(vi) for vi in vert_indices_list)
|
total_verts = sum(len(vi) for vi in indices_list)
|
||||||
self.vert_indices = resize_array(self.vert_indices, total_verts)
|
self.vert_indices = resize_array(self.vert_indices, total_verts)
|
||||||
|
|
||||||
n_points = 0
|
n_points = 0
|
||||||
n_verts = 0
|
n_verts = 0
|
||||||
for k, data in enumerate(vert_data_list):
|
for k, data in enumerate(data_list):
|
||||||
new_n_points = n_points + len(data)
|
new_n_points = n_points + len(data)
|
||||||
self.vert_data[n_points:new_n_points] = data
|
self.vert_data[n_points:new_n_points] = data
|
||||||
if self.vert_indices is not None and vert_indices_list is not None:
|
if self.vert_indices is not None and indices_list is not None:
|
||||||
vert_indices = vert_indices_list[k]
|
vert_indices = indices_list[k]
|
||||||
new_n_verts = n_verts + len(vert_indices)
|
new_n_verts = n_verts + len(vert_indices)
|
||||||
self.vert_indices[n_verts:new_n_verts] = vert_indices + n_points
|
self.vert_indices[n_verts:new_n_verts] = vert_indices + n_points
|
||||||
n_verts = new_n_verts
|
n_verts = new_n_verts
|
||||||
|
|
Loading…
Add table
Reference in a new issue