Skip to content

Commit 88c67b4

Browse files
authored
Added times of last load (#23)
1 parent e2e59b8 commit 88c67b4

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

bseq/importer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .utils import show_message_box
88
import numpy as np
99
from mathutils import Matrix
10+
import time
1011
# this import is not useless
1112
import additional_file_formats
1213

@@ -233,6 +234,8 @@ def create_obj(fileseq, use_relative, root_path, transform_matrix=Matrix([[1, 0,
233234
def update_obj(scene, depsgraph=None):
234235

235236
for obj in bpy.data.objects:
237+
start_time = time.perf_counter()
238+
236239
if obj.BSEQ.init == False:
237240
continue
238241
if obj.BSEQ.enabled == False:
@@ -302,4 +305,6 @@ def update_obj(scene, depsgraph=None):
302305
update_mesh(meshio_mesh, obj.data)
303306

304307
apply_transformation(meshio_mesh, obj, depsgraph)
305-
308+
309+
end_time = time.perf_counter()
310+
obj.BSEQ.last_benchmark = (end_time - start_time) * 1000

bseq/panels.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ def draw(self, context):
116116
col2.prop(obj.BSEQ, 'use_relative', text="")
117117
col1.label(text='Pattern')
118118
col2.prop(obj.BSEQ, 'pattern', text="")
119+
col1.label(text='Last loading time (ms)')
120+
col2.prop(obj.BSEQ, 'last_benchmark', text="")
119121

120122
# geometry nodes settings
121123
layout.label(text="Geometry Nodes")

bseq/properties.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class BSEQ_obj_property(bpy.types.PropertyGroup):
8484
pattern: bpy.props.StringProperty()
8585
frame: bpy.props.IntProperty()
8686
start_end_frame: bpy.props.IntVectorProperty(name="Start and End Frames", size=2, default=(0, 0))
87+
last_benchmark: bpy.props.FloatProperty(name="Last Loading Time")
8788

8889
# set this property for mesh, not object (maybe change later?)
8990
class BSEQ_mesh_property(bpy.types.PropertyGroup):

0 commit comments

Comments
 (0)