refresh_aggregate to show time it took

since this can get very time consuming on large projects
This commit is contained in:
Andrej730
2023-10-17 14:15:46 +05:00
parent cef9ba6001
commit df745345d5
@@ -34,6 +34,7 @@ import blenderbim.core.drawing
import blenderbim.tool as tool import blenderbim.tool as tool
import blenderbim.bim.handler import blenderbim.bim.handler
from mathutils import Vector, Matrix from mathutils import Vector, Matrix
from time import time
from blenderbim.bim import import_ifc from blenderbim.bim import import_ifc
from blenderbim.bim.ifc import IfcStore from blenderbim.bim.ifc import IfcStore
@@ -1161,6 +1162,7 @@ class RefreshAggregate(bpy.types.Operator):
return {"FINISHED"} return {"FINISHED"}
def _execute(self, context): def _execute(self, context):
refresh_start_time = time()
self.new_active_obj = None self.new_active_obj = None
old_to_new = {} old_to_new = {}
@@ -1364,6 +1366,9 @@ class RefreshAggregate(bpy.types.Operator):
blenderbim.bim.handler.refresh_ui_data() blenderbim.bim.handler.refresh_ui_data()
operator_time = time() - refresh_start_time
if operator_time > 10:
self.report({"INFO"}, "Refresh Aggregate was finished in {:.2f} seconds".format(operator_time))
return {"FINISHED"} return {"FINISHED"}