Skip to content

Commit 0ef6659

Browse files
committed
Custom normals export: use dtype=np.float32 to improve performance, rename intermediate array to final array
1 parent 2f0636c commit 0ef6659

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

export/mesh_converter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def get_custom_normals_slow(mesh):
3131
# However, foreach_get() needs a flat sequence,
3232
# so to save two ravel() operations, a flat array is used directly
3333
n_loops = len(mesh.loops)
34-
split_normals_array = np.empty(n_loops * 3)
35-
mesh.loops.foreach_get('normal', split_normals_array)
36-
custom_normals = split_normals_array.tolist() # currently, LuxCore is hard-coded to expect a list.
34+
custom_normals = np.empty(n_loops * 3, dtype = np.float32)
35+
mesh.loops.foreach_get('normal', custom_normals)
36+
custom_normals = custom_normals.tolist() # currently, LuxCore is hard-coded to expect a list.
3737

3838
return custom_normals
3939

0 commit comments

Comments
 (0)