Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-23 00:41:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-23 00:41:21 +0300
commit1efbaf92ae58278c0b5675b35f3a0970265cb895 (patch)
tree3112322307935c6be5f2020810e1b68cbcabefc0 /io_mesh_raw
parentd6026d486e5b8349f513774e7e9ebadbfe029091 (diff)
use imp.reload() rather then reload().
Diffstat (limited to 'io_mesh_raw')
-rw-r--r--io_mesh_raw/__init__.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/io_mesh_raw/__init__.py b/io_mesh_raw/__init__.py
index d52a5808..4cb44a86 100644
--- a/io_mesh_raw/__init__.py
+++ b/io_mesh_raw/__init__.py
@@ -31,27 +31,22 @@ bl_addon_info = {
"func=detail&aid=21733&group_id=153&atid=469",
"category": "Import/Export"}
-import bpy
-
+if "bpy" in locals():
+ import imp
+ imp.reload(import_raw)
+ imp.reload(export_raw)
+else:
+ from . import import_raw
+ from . import export_raw
-try:
- init_data
- reload(import_raw)
- reload(export_raw)
-except:
- from io_mesh_raw import import_raw
- from io_mesh_raw import export_raw
-
-init_data = True
+import bpy
def menu_import(self, context):
- from io_mesh_raw import import_raw
self.layout.operator(import_raw.RawImporter.bl_idname, text="Raw Faces (.raw)").filepath = "*.raw"
def menu_export(self, context):
- from io_mesh_raw import export_raw
import os
default_path = os.path.splitext(bpy.data.filepath)[0] + ".raw"
self.layout.operator(export_raw.RawExporter.bl_idname, text="Raw Faces (.raw)").filepath = default_path