Skip to content

Commit

Permalink
BUGFIXES:
Browse files Browse the repository at this point in the history
- "Indication must be 'sperical' or 'planar'" error message if pyproj module is not available.
- GeoReference options (lat/lon) was disabled without pyproj
  • Loading branch information
Lukas Treyer committed Aug 29, 2014
1 parent 03bdb32 commit 97816cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 11 additions & 4 deletions io_import_dxf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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")

Expand Down
6 changes: 3 additions & 3 deletions io_import_dxf/dxfimport/do.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 97816cf

Please sign in to comment.