[Bf-extensions-cvs] [97816cf] master: BUGFIXES: - "Indication must be 'sperical' or 'planar'" error message if pyproj module is not available. - GeoReference options (lat/lon) was disabled without pyproj

Lukas Treyer noreply at git.blender.org
Fri Aug 29 12:25:25 CEST 2014


Commit: 97816cfd9d9471615d88819bd39c9975523ec892
Author: Lukas Treyer
Date:   Fri Aug 29 12:24:49 2014 +0200
Branches: master
https://developer.blender.org/rBA97816cfd9d9471615d88819bd39c9975523ec892

BUGFIXES:
- "Indication must be 'sperical' or 'planar'" error message if pyproj module is not available.
- GeoReference options (lat/lon) was disabled without pyproj

===================================================================

M	io_import_dxf/__init__.py
M	io_import_dxf/dxfimport/do.py

===================================================================

diff --git a/io_import_dxf/__init__.py b/io_import_dxf/__init__.py
index 9c53963..e3cfa99 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 0e39c5a..82fea41 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:



More information about the Bf-extensions-cvs mailing list