Skip to content

Commit 465a4c3

Browse files
committed
Fixes for custom normals.
1 parent 9f5c033 commit 465a4c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

BEngine-Py/bengine/Utils/BEUtilsGeo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,15 @@ def MeshToJSONData(mesh, engine_type: EngineType):
258258
# Get Normals
259259
if BESettings.BENGINE_NORMAL in mesh.attributes.keys():
260260
normal_attr = mesh.attributes[BESettings.BENGINE_NORMAL]
261+
data_type = normal_attr.data_type
261262

262263
if normal_attr.domain == 'CORNER':
263-
if data_type == 'VECTOR':
264+
if data_type == 'FLOAT_VECTOR':
264265
np_normals = np.empty(len(normal_attr.data) * 3, dtype=np.float32)
265266
normal_attr.data.foreach_get('vector', np_normals)
266267
# np_normals.shape = (len(normal_attr.data), 3)
267268
else:
268-
print("Attribute" + attrib_name + " has "
269+
print("Attribute" + BESettings.BENGINE_NORMAL + " has "
269270
+ data_type + " Type. It's not supported and passed. Standard Normals are used instead!!!")
270271
np_normals = GetMeshNormalsNumpy(mesh)
271272
else:

0 commit comments

Comments
 (0)