Skip to content

Commit a04840b

Browse files
committed
some little tweaks for normals checking.
1 parent c4a7485 commit a04840b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

BEngine-Py/bengine/Utils/BEGeoUtils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def CreateMesh(polys_len, np_verts, np_poly_indices, np_normals):
4444
mesh.update()
4545

4646
# Normals
47-
if np_normals is not None:
47+
if np_normals is not None and len(np_normals) > 0:
4848
mesh.normals_split_custom_set_from_vertices(np_normals)
4949
# normals2 = [js_mesh["Normals"][loop.vertex_index] for loop in be_sub_mesh.loops]
5050
# be_sub_mesh.normals_split_custom_set(normals2)
@@ -66,7 +66,6 @@ def MeshFromJSON(js_mesh, engine_type: EngineType):
6666
np_normals = None
6767
if "Normals" in js_mesh:
6868
np_normals = np.asarray(js_mesh["Normals"], dtype=np.float32)
69-
# np_normals.shape = len(js_mesh["Normals"]) * 3
7069
np_normals.shape = (int(len(np_normals) / 3), 3)
7170

7271
# Get UVs

0 commit comments

Comments
 (0)