Avoid modification of python system paths
This isn't a proper way to solve the import problem, use relative import instead.
This commit is contained in:
parent
1b9a94b5f9
commit
606fbde1c3
|
@ -39,18 +39,6 @@ bl_info = {
|
|||
import sys
|
||||
import os
|
||||
|
||||
# ----------------------------------------------
|
||||
# Add to Phyton path (once only)
|
||||
# ----------------------------------------------
|
||||
path = sys.path
|
||||
flag = False
|
||||
for item in path:
|
||||
if "archimesh" in item:
|
||||
flag = True
|
||||
if flag is False:
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'archimesh'))
|
||||
print("archimesh: added to phytonpath")
|
||||
|
||||
# ----------------------------------------------
|
||||
# Import modules
|
||||
# ----------------------------------------------
|
||||
|
@ -72,20 +60,20 @@ if "bpy" in locals():
|
|||
imp.reload(achm_window_panel)
|
||||
print("archimesh: Reloaded multifiles")
|
||||
else:
|
||||
import achm_books_maker
|
||||
import achm_column_maker
|
||||
import achm_curtain_maker
|
||||
import achm_venetian_maker
|
||||
import achm_door_maker
|
||||
import achm_kitchen_maker
|
||||
import achm_lamp_maker
|
||||
import achm_main_panel
|
||||
import achm_roof_maker
|
||||
import achm_room_maker
|
||||
import achm_shelves_maker
|
||||
import achm_stairs_maker
|
||||
import achm_window_maker
|
||||
import achm_window_panel
|
||||
from . import achm_books_maker
|
||||
from . import achm_column_maker
|
||||
from . import achm_curtain_maker
|
||||
from . import achm_venetian_maker
|
||||
from . import achm_door_maker
|
||||
from . import achm_kitchen_maker
|
||||
from . import achm_lamp_maker
|
||||
from . import achm_main_panel
|
||||
from . import achm_roof_maker
|
||||
from . import achm_room_maker
|
||||
from . import achm_shelves_maker
|
||||
from . import achm_stairs_maker
|
||||
from . import achm_window_maker
|
||||
from . import achm_window_panel
|
||||
|
||||
print("archimesh: Imported multifiles")
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import math
|
|||
import random
|
||||
import copy
|
||||
import colorsys
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
# noinspection PyUnresolvedReferences
|
||||
import bpy
|
||||
import math
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -28,7 +28,7 @@ import bpy
|
|||
import colorsys
|
||||
import copy
|
||||
import math
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -27,7 +27,7 @@ import bpy
|
|||
import math
|
||||
# noinspection PyUnresolvedReferences
|
||||
from bpy.props import *
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -34,7 +34,7 @@ import math
|
|||
import mathutils
|
||||
# noinspection PyUnresolvedReferences
|
||||
from bpy_extras import view3d_utils
|
||||
from achm_room_maker import get_wall_points
|
||||
from .achm_room_maker import get_wall_points
|
||||
|
||||
|
||||
# -------------------------------------------------------------
|
||||
|
|
|
@ -29,7 +29,7 @@ import copy
|
|||
import sys
|
||||
import datetime
|
||||
import time
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
from bpy_extras.io_utils import ExportHelper
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
import bpy
|
||||
import math
|
||||
import copy
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
import bpy
|
||||
# noinspection PyUnresolvedReferences
|
||||
import bgl
|
||||
from achm_tools import *
|
||||
from achm_gltools import *
|
||||
from .achm_tools import *
|
||||
from .achm_gltools import *
|
||||
|
||||
|
||||
# -----------------------------------------------------
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
# noinspection PyUnresolvedReferences
|
||||
import bpy
|
||||
import math
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -30,7 +30,7 @@ import math
|
|||
import mathutils
|
||||
import datetime
|
||||
import time
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
# noinspection PyUnresolvedReferences
|
||||
from bpy_extras.io_utils import ExportHelper, ImportHelper
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# ----------------------------------------------------------
|
||||
import bpy
|
||||
import copy
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
# noinspection PyUnresolvedReferences
|
||||
import bpy
|
||||
import math
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -27,7 +27,7 @@ import bpy
|
|||
import math
|
||||
# noinspection PyUnresolvedReferences
|
||||
from bpy.props import *
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -27,7 +27,7 @@ import bpy
|
|||
import math
|
||||
# noinspection PyUnresolvedReferences
|
||||
from bpy.props import *
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
|
|
@ -31,7 +31,7 @@ import bpy
|
|||
import math
|
||||
# noinspection PyUnresolvedReferences
|
||||
import mathutils
|
||||
from achm_tools import *
|
||||
from .achm_tools import *
|
||||
|
||||
|
||||
def fitil(vr, fc, px, pz, x, y, z, zz, xx):
|
||||
|
|
|
@ -39,18 +39,6 @@ bl_info = {
|
|||
import sys
|
||||
import os
|
||||
|
||||
# ----------------------------------------------
|
||||
# Add to Phyton path (once only)
|
||||
# ----------------------------------------------
|
||||
path = sys.path
|
||||
flag = False
|
||||
for item in path:
|
||||
if "measureit" in item:
|
||||
flag = True
|
||||
if flag is False:
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'measureit'))
|
||||
print("measureit: added to phytonpath")
|
||||
|
||||
# ----------------------------------------------
|
||||
# Import modules
|
||||
# ----------------------------------------------
|
||||
|
@ -60,7 +48,7 @@ if "bpy" in locals():
|
|||
imp.reload(measureit_main)
|
||||
print("measureit: Reloaded multifiles")
|
||||
else:
|
||||
import measureit_main
|
||||
from . import measureit_main
|
||||
|
||||
print("measureit: Imported multifiles")
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ import bgl
|
|||
# noinspection PyUnresolvedReferences
|
||||
from bpy.app.handlers import persistent
|
||||
# noinspection PyUnresolvedReferences
|
||||
from measureit_geometry import *
|
||||
from measureit_render import *
|
||||
from .measureit_geometry import *
|
||||
from .measureit_render import *
|
||||
|
||||
|
||||
# ------------------------------------------------------
|
||||
|
|
|
@ -42,7 +42,7 @@ import bpy_extras.object_utils as object_utils
|
|||
# noinspection PyUnresolvedReferences
|
||||
from bpy_extras import view3d_utils
|
||||
from math import ceil
|
||||
from measureit_geometry import *
|
||||
from .measureit_geometry import *
|
||||
|
||||
|
||||
# -------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue