From 082dde416b81cd53a209be545ea3aa8b8e073dd7 Mon Sep 17 00:00:00 2001 From: "Ilya V. Portnov" Date: Wed, 8 Nov 2023 22:01:25 +0500 Subject: [PATCH] Fix error with newer numpy. moreover, documentation to vectorize() says that it is slower than direct iteration. --- utils/modules/polygon_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/modules/polygon_utils.py b/utils/modules/polygon_utils.py index 409fe29ab0..85c16953da 100644 --- a/utils/modules/polygon_utils.py +++ b/utils/modules/polygon_utils.py @@ -292,8 +292,7 @@ def np_process_polygons(verts, faces, func=None, dims=3, output_numpy=False): np_faces = np.array(faces,dtype=object) if np_faces.dtype == object: - np_len = np.vectorize(len) - lens = np_len(np_faces) + lens = np.array([len(i) for i in np_faces]) pol_types = np.unique(lens) if dims == 1: vals = np.zeros(np_faces.shape[0], dtype=float)