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:
authorLukas Treyer <treyer@arch.ethz.ch>2014-08-29 14:24:49 +0400
committerLukas Treyer <treyer@arch.ethz.ch>2014-08-29 14:24:49 +0400
commit97816cfd9d9471615d88819bd39c9975523ec892 (patch)
treecdf5544ea8829962d5ff7eda73f4769687529c78 /io_import_dxf
parent03bdb32829fe973efe33d16da81f54d26cd1c2c6 (diff)
BUGFIXES:
- "Indication must be 'sperical' or 'planar'" error message if pyproj module is not available. - GeoReference options (lat/lon) was disabled without pyproj
Diffstat (limited to 'io_import_dxf')
-rw-r--r--io_import_dxf/__init__.py15
-rw-r--r--io_import_dxf/dxfimport/do.py6
2 files changed, 14 insertions, 7 deletions
diff --git a/io_import_dxf/__init__.py b/io_import_dxf/__init__.py
index 9c539634..e3cfa99b 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 @@ class IMPORT_OT_dxf(bpy.types.Operator):
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 0e39c5a9..82fea417 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: