[Bf-extensions-cvs] [fd8d632] master: CMU mocap browser: changed importing of submodules

Sybren A. Stüvel noreply at git.blender.org
Fri Mar 20 10:21:52 CET 2015


Commit: fd8d6328bf7d5024627b32081a7c108ad5b7057f
Author: Sybren A. Stüvel
Date:   Fri Mar 20 10:21:34 2015 +0100
Branches: master
https://developer.blender.org/rBACfd8d6328bf7d5024627b32081a7c108ad5b7057f

CMU mocap browser: changed importing of submodules

The new way should support reloading.

===================================================================

M	cmu_mocap_browser/__init__.py

===================================================================

diff --git a/cmu_mocap_browser/__init__.py b/cmu_mocap_browser/__init__.py
index 7feaeb9..243e3bc 100644
--- a/cmu_mocap_browser/__init__.py
+++ b/cmu_mocap_browser/__init__.py
@@ -35,15 +35,21 @@ bl_info = {
     "category": "Animation"}
 
 
+if 'bpy' in locals():
+    import importlib
+    library = importlib.reload(library)
+    download = importlib.reload(download)
+    makehuman = importlib.reload(makehuman)
+    initialize_subjects = importlib.reload(initialize_subjects)
+    update_motions = importlib.reload(update_motions)
+else:
+    from . import library
+    from . import download
+    from . import makehuman
+    from .data import initialize_subjects, update_motions
+
 import os
 import bpy
-import bgl
-import blf
-import math
-from . import library
-from . import download
-from . import makehuman
-from .data import initialize_subjects, update_motions
 
 
 class CMUMocapSubjectBrowser(bpy.types.Panel):



More information about the Bf-extensions-cvs mailing list