in debug mode report the time to load addon modules.

This commit is contained in:
2010-07-26 09:09:53 +00:00
parent ed5d0bb62f
commit 15e94823dd
2 changed files with 10 additions and 1 deletions

View File

@@ -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