diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 14:10:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 14:10:29 +0300 |
commit | 5a322bd67cf1f99b4d8fc26e50edb22904f58b9e (patch) | |
tree | 4739ef0abd2ce0dd110f93742e3faf9e7543fba7 /release/scripts/op | |
parent | b17964af11a1acab393ac2d51b2b0bd55a8c127c (diff) |
F8 reload works again, script errors are printed but dont stop loading every other script
Diffstat (limited to 'release/scripts/op')
-rw-r--r-- | release/scripts/op/wm.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index e65002ee0c0..39bd65eec25 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -362,6 +362,37 @@ class WM_OT_doc_edit(bpy.types.Operator): return ('RUNNING_MODAL',) +class WM_OT_reload_scripts(bpy.types.Operator): + '''Load online reference docs''' + bl_idname = "wm.reload_scripts" + bl_label = "Reload Scripts" + + def execute(self, context): + MOD = type(bpy) + import sys + bpy.load_scripts(True) + ''' + prefix = bpy.base_path + items = list(sys.modules.items()) + items.sort() + items.reverse() + for mod_name, mod in items: + mod_file = getattr(mod, "__file__", "") + if mod_file.startswith(prefix) and "__init__" not in mod_file: + print(mod_file) + reload(mod) + """ + for submod_name in dir(mod): + submod = getattr(mod, submod_name) + if isinstance(submod, MOD): + reload(submod) + """ + else: + print("Ignoring:", mod, mod_file) + ''' + return ('FINISHED',) + + bpy.ops.add(MESH_OT_delete_edgeloop) bpy.ops.add(WM_OT_context_set_boolean) @@ -376,3 +407,5 @@ bpy.ops.add(WM_OT_context_cycle_int) bpy.ops.add(WM_OT_doc_view) bpy.ops.add(WM_OT_doc_edit) + +bpy.ops.add(WM_OT_reload_scripts) |