-
Notifications
You must be signed in to change notification settings - Fork 233
/
numpy.diff
54 lines (49 loc) · 2.79 KB
/
numpy.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/utils/blender_mesh.py b/utils/blender_mesh.py
index 5496c470b..3c515b7b6 100644
--- a/utils/blender_mesh.py
+++ b/utils/blender_mesh.py
@@ -19,35 +19,35 @@
import numpy as np
# taken from here https://blenderartists.org/t/efficient-copying-of-vertex-coords-to-and-from-numpy-arrays/661467/3
def read_verts(blender_mesh, output_numpy=False):
- mverts_co = np.zeros((len(blender_mesh.vertices)*3), dtype=np.float)
+ mverts_co = np.zeros((len(blender_mesh.vertices)*3), dtype=np.float64)
blender_mesh.vertices.foreach_get("co", mverts_co)
if output_numpy:
return np.reshape(mverts_co, (len(blender_mesh.vertices), 3))
return np.reshape(mverts_co, (len(blender_mesh.vertices), 3)).tolist()
def read_verts_normal(blender_mesh, output_numpy=False):
- mverts_normals = np.zeros((len(blender_mesh.vertices)*3), dtype=np.float)
+ mverts_normals = np.zeros((len(blender_mesh.vertices)*3), dtype=np.float64)
blender_mesh.vertices.foreach_get("normal", mverts_normals)
if output_numpy:
return np.reshape(mverts_normals, (len(blender_mesh.vertices), 3))
return np.reshape(mverts_normals, (len(blender_mesh.vertices), 3)).tolist()
def read_face_normal(blender_mesh, output_numpy=False):
- mface_normals = np.zeros((len(blender_mesh.polygons)*3), dtype=np.float)
+ mface_normals = np.zeros((len(blender_mesh.polygons)*3), dtype=np.float64)
blender_mesh.polygons.foreach_get("normal", mface_normals)
if output_numpy:
return np.reshape(mface_normals, (len(blender_mesh.polygons), 3))
return np.reshape(mface_normals, (len(blender_mesh.polygons), 3)).tolist()
def read_face_center(blender_mesh, output_numpy=False):
- centers = np.zeros((len(blender_mesh.polygons)*3), dtype=np.float)
+ centers = np.zeros((len(blender_mesh.polygons)*3), dtype=np.float64)
blender_mesh.polygons.foreach_get("center", centers)
if output_numpy:
return np.reshape(centers, (len(blender_mesh.polygons), 3))
return np.reshape(centers, (len(blender_mesh.polygons), 3)).tolist()
def read_face_area(blender_mesh, output_numpy=False):
- areas = np.zeros((len(blender_mesh.polygons)), dtype=np.float)
+ areas = np.zeros((len(blender_mesh.polygons)), dtype=np.float64)
blender_mesh.polygons.foreach_get("area", areas)
if output_numpy:
return areas
@@ -61,7 +61,7 @@ def read_edges(blender_mesh, output_numpy=False):
return np.reshape(fastedges, (len(blender_mesh.edges), 2)).tolist()
def read_materials_idx(blender_mesh, output_numpy=False):
- material_index = np.zeros((len(blender_mesh.polygons)), dtype=np.float)
+ material_index = np.zeros((len(blender_mesh.polygons)), dtype=np.float64)
blender_mesh.polygons.foreach_get("material_index", material_index)
if output_numpy:
return material_index