in debug mode report the time to load addon modules.
This commit is contained in:
parent
ed5d0bb62f
commit
15e94823dd
@ -210,7 +210,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
print("gc.collect() -> %d" % gc.collect())
|
||||
|
||||
if _bpy.app.debug:
|
||||
print("Time %.4f" % (time.time() - t_main))
|
||||
print("Python Script Load Time %.4f" % (time.time() - t_main))
|
||||
|
||||
|
||||
def expandpath(path):
|
||||
|
@ -829,14 +829,23 @@ class USERPREF_PT_addons(bpy.types.Panel):
|
||||
@staticmethod
|
||||
def _addon_list():
|
||||
import sys
|
||||
import time
|
||||
|
||||
modules = []
|
||||
loaded_modules = set()
|
||||
paths = bpy.utils.script_paths("addons")
|
||||
|
||||
if bpy.app.debug:
|
||||
t_main = time.time()
|
||||
|
||||
# sys.path.insert(0, None)
|
||||
for path in paths:
|
||||
# sys.path[0] = path
|
||||
modules.extend(bpy.utils.modules_from_path(path, loaded_modules))
|
||||
|
||||
if bpy.app.debug:
|
||||
print("Addon Script Load Time %.4f" % (time.time() - t_main))
|
||||
|
||||
# del sys.path[0]
|
||||
return modules
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user