Skip to content

Commit 5b36b1c

Browse files
committed
Minor updates (with old mesh loading)
1 parent 3b64e07 commit 5b36b1c

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

bseq/importer.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ def update_mesh(meshio_mesh, mesh):
119119
# Add a zero as first entry
120120
faces_loop_start = np.roll(faces_loop_start, 1)
121121
faces_loop_start[0] = 0
122-
123-
start_time = time.perf_counter()
124-
122+
125123
if len(mesh.vertices) == n_verts and len(mesh.polygons) == n_poly and len(mesh.loops) == n_loop:
126124
pass
127125
else:
@@ -130,20 +128,16 @@ def update_mesh(meshio_mesh, mesh):
130128
mesh.loops.add(n_loop)
131129
mesh.polygons.add(n_poly)
132130

133-
134131
mesh.vertices.foreach_set("co", mesh_vertices.ravel())
135132
mesh.loops.foreach_set("vertex_index", loops_vert_idx)
136133
mesh.polygons.foreach_set("loop_start", faces_loop_start)
137134
mesh.polygons.foreach_set("loop_total", faces_loop_total)
138135
mesh.polygons.foreach_set("use_smooth", [shade_scheme] * len(faces_loop_total))
139136

137+
# newer function but is about 4 times slower
140138
# mesh.clear_geometry()
141139
# mesh.from_pydata(mesh_vertices, [], data)
142140

143-
end_time = time.perf_counter()
144-
print("foreach_set time: ", end_time - start_time)
145-
146-
147141
mesh.update()
148142
mesh.validate()
149143

@@ -219,7 +213,6 @@ def create_obj(fileseq, use_relative, root_path, transform_matrix=Matrix([[1, 0,
219213
#.obj sequences have to be handled differently
220214
isObj = filepath.endswith(".obj")
221215
if isObj and bpy.context.scene.BSEQ.use_blender_obj_import:
222-
print(str(filepath))
223216
bpy.ops.import_scene.obj(filepath=filepath)
224217
enabled = True
225218

@@ -303,9 +296,6 @@ def update_obj(scene, depsgraph=None):
303296
# Reload the object
304297
bpy.ops.import_scene.obj(filepath=filepath)
305298
tmp_obj = bpy.context.selected_objects[-1]
306-
print(str(filepath))
307-
print(current_frame % len(fs))
308-
print(obj.name)
309299

310300
obj.data = tmp_obj.data
311301
tmp_obj.select_set(True)

0 commit comments

Comments
 (0)