Vectorize UV initialization with numpy broadcasting
This commit is contained in:
parent
8c4def54af
commit
14b032eae1
1 changed files with 1 additions and 5 deletions
|
|
@ -535,11 +535,7 @@ class Art:
|
|||
shape = (layers, self.height, self.width, UV_STRIDE)
|
||||
array = np.zeros(shape, dtype=np.float32)
|
||||
# default new layer of UVs to "normal" transform
|
||||
uvs = uv_types[UV_NORMAL]
|
||||
for layer in range(layers):
|
||||
for y in range(self.height):
|
||||
for x in range(self.width):
|
||||
array[layer][y][x] = uvs
|
||||
array[:] = uv_types[UV_NORMAL]
|
||||
return array
|
||||
|
||||
def is_tile_inside(self, x, y):
|
||||
|
|
|
|||
Loading…
Reference in a new issue