[Bf-extensions-cvs] [c992b17b] master: archipack: 2d to 3d warning for shapely and enable in user prefs

Stephen Leger noreply at git.blender.org
Mon Jul 24 16:03:57 CEST 2017


Commit: c992b17be98e245d1d2c7a7ecb557241e10b6f32
Author: Stephen Leger
Date:   Mon Jul 24 16:03:40 2017 +0200
Branches: master
https://developer.blender.org/rBAc992b17be98e245d1d2c7a7ecb557241e10b6f32

archipack: 2d to 3d warning for shapely and enable in user prefs

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

M	archipack/__init__.py

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

diff --git a/archipack/__init__.py b/archipack/__init__.py
index 6b4313ac..6c966614 100644
--- a/archipack/__init__.py
+++ b/archipack/__init__.py
@@ -34,7 +34,7 @@ bl_info = {
     'version': (1, 2, 6),
     'blender': (2, 7, 8),
     'location': 'View3D > Tools > Create > Archipack',
-    'warning': '',
+    'warning': '2d to 3d require shapely python module (see setup in documentation)',
     'wiki_url': 'https://github.com/s-leger/archipack/wiki',
     'tracker_url': 'https://github.com/s-leger/archipack/issues',
     'link': 'https://github.com/s-leger/archipack',
@@ -97,6 +97,7 @@ else:
 
     print("archipack: ready")
 
+
 # noinspection PyUnresolvedReferences
 import bpy
 # noinspection PyUnresolvedReferences
@@ -154,6 +155,11 @@ class Archipack_Pref(AddonPreferences):
         description="Put Achipack's object into a sub menu (shift+a)",
         default=True
     )
+    enable_2d_to_3d = BoolProperty(
+        name="Enable 2d to 3d",
+        description="Enable 2d to 3d module",
+        default=False
+    )
     max_style_draw_tool = BoolProperty(
         name="Draw a wall use 3dsmax style",
         description="Reverse clic / release cycle for Draw a wall",
@@ -241,7 +247,15 @@ class Archipack_Pref(AddonPreferences):
         col.prop(self, "tools_category")
         col.prop(self, "create_category")
         col.prop(self, "create_submenu")
-        col.prop(self, "max_style_draw_tool")
+        box = layout.box()
+        box.label("Features")
+        box.prop(self, "max_style_draw_tool")
+        box = layout.box()
+        box.label("2d to 3d")
+        if not HAS_POLYLIB:
+            box.label(text="WARNING Shapely python module not found", icon="ERROR")
+            box.label(text="2d to 3d tools are disabled, see setup in documentation")
+        box.prop(self, "enable_2d_to_3d")
         box = layout.box()
         row = box.row()
         split = row.split(percentage=0.5)
@@ -284,8 +298,10 @@ class TOOLS_PT_Archipack_PolyLib(Panel):
     def poll(self, context):
 
         global archipack_polylib
-        return HAS_POLYLIB and ((archipack_polylib.vars_dict['select_polygons'] is not None) or
-                (context.object is not None and context.object.type == 'CURVE'))
+        return (HAS_POLYLIB and
+                context.user_preferences.addons[__name__].preferences.enable_2d_to_3d and
+                ((archipack_polylib.vars_dict['select_polygons'] is not None) or
+                (context.object is not None and context.object.type == 'CURVE')))
 
     def draw(self, context):
         global icons_collection



More information about the Bf-extensions-cvs mailing list