diff --git a/io_import_dxf/__init__.py b/io_import_dxf/__init__.py index 9c539634c..e3cfa99b7 100644 --- a/io_import_dxf/__init__.py +++ b/io_import_dxf/__init__.py @@ -155,9 +155,14 @@ def _update_use_georeferencing_do(self, context): def _recenter_allowed(self): scene = bpy.context.scene - return (not (self.use_georeferencing and (self.proj_scene == 'TMERC' - or (not self.create_new_scene and is_ref_scene(scene)))) - or (not PYPROJ and self.dxf_indi == "EUCLIDEAN")) + conditional_requirement = self.proj_scene == 'TMERC' if PYPROJ else self.dxf_indi == "SPHERICAL" + return not ( + self.use_georeferencing and + ( + conditional_requirement or + (not self.create_new_scene and is_ref_scene(scene)) + ) + ) def _set_recenter(self, value): @@ -410,7 +415,9 @@ def draw_merc(self, box): sub.enabled = not _recenter_allowed(self) sub.label("Geo Reference:") sub = box.column() - sub.enabled = not _recenter_allowed(self) and self.create_new_scene + sub.enabled = not _recenter_allowed(self) + if is_ref_scene(bpy.context.scene): + sub.enabled = False sub.prop(self, "merc_scene_lat", text="Lat") sub.prop(self, "merc_scene_lon", text="Lon") diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py index 0e39c5a9d..82fea4179 100644 --- a/io_import_dxf/dxfimport/do.py +++ b/io_import_dxf/dxfimport/do.py @@ -80,12 +80,12 @@ class Indicator: euclidean = False def __init__(self, i): - if i == "spherical": + if i.upper() == "SPHERICAL": self.spherical = True - elif i == "euclidean": + elif i.upper() == "EUCLIDEAN": self.euclidean = True else: - raise AttributeError("Indication must be 'spherical' or 'planar'.") + raise AttributeError("Indication must be 'spherical' or 'euclidean'. Given: " + str(i)) class Do: