Skip to content

Commit c1e00c4

Browse files
committed
UVs now have only 2 coordinates when they are exported from Blender.
1 parent bb28d54 commit c1e00c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

BEngine-Py/bengine/Utils/BEGeoUtils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,14 @@ def MeshToJSONData(mesh):
289289
continue
290290

291291
np_uv_attrib = np.empty(len(parsed_attr.data) * uv_vec_len, dtype=np.float32)
292-
293292
parsed_attr.data.foreach_get('vector', np_uv_attrib)
293+
294+
# Remove Third Coordinate
295+
if uv_vec_len == 3 and len(np_uv_attrib) > 2:
296+
# print(np_uv_attrib)
297+
np_uv_attrib = np.delete(np_uv_attrib, np.arange(2, len(np_uv_attrib), 3))
298+
# print(np_uv_attrib)
299+
294300
uvs_dict[attrib_name] = np_uv_attrib.tolist()
295301

296302
else:

0 commit comments

Comments
 (0)