[Bf-extensions-cvs] [bfbbd112] blender2.8: archipack 2.8 compatibility (step1)

Stephen Leger noreply at git.blender.org
Fri Nov 16 15:35:13 CET 2018


Commit: bfbbd112c170d96e86838208b8781fd46df52514
Author: Stephen Leger
Date:   Fri Nov 16 15:31:26 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBAbfbbd112c170d96e86838208b8781fd46df52514

archipack 2.8 compatibility (step1)

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

M	archipack/__init__.py
M	archipack/archipack_2d.py
M	archipack/archipack_autoboolean.py
M	archipack/archipack_cutter.py
M	archipack/archipack_door.py
M	archipack/archipack_fence.py
M	archipack/archipack_floor.py
M	archipack/archipack_gl.py
M	archipack/archipack_handle.py
M	archipack/archipack_keymaps.py
M	archipack/archipack_manipulator.py
M	archipack/archipack_material.py
M	archipack/archipack_object.py
M	archipack/archipack_preset.py
M	archipack/archipack_reference_point.py
M	archipack/archipack_rendering.py
M	archipack/archipack_roof.py
M	archipack/archipack_slab.py
M	archipack/archipack_snap.py
M	archipack/archipack_stair.py
M	archipack/archipack_thumbs.py
M	archipack/archipack_truss.py
M	archipack/archipack_wall2.py
M	archipack/archipack_window.py
M	archipack/bmesh_utils.py

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

diff --git a/archipack/__init__.py b/archipack/__init__.py
index 8b87585b..74f4f761 100644
--- a/archipack/__init__.py
+++ b/archipack/__init__.py
@@ -31,8 +31,8 @@ bl_info = {
     'author': 's-leger',
     'license': 'GPL',
     'deps': '',
-    'version': (1, 2, 8),
-    'blender': (2, 7, 8),
+    'version': (1, 2, 81),
+    'blender': (2, 80, 0),
     'location': 'View3D > Tools > Create > Archipack',
     'warning': '',
     'wiki_url': 'https://github.com/s-leger/archipack/wiki',
@@ -46,7 +46,6 @@ import os
 
 if "bpy" in locals():
     import importlib as imp
-    imp.reload(archipack_progressbar)
     imp.reload(archipack_material)
     imp.reload(archipack_snap)
     imp.reload(archipack_manipulator)
@@ -65,7 +64,6 @@ if "bpy" in locals():
 
     # print("archipack: reload ready")
 else:
-    from . import archipack_progressbar
     from . import archipack_material
     from . import archipack_snap
     from . import archipack_manipulator
@@ -81,8 +79,7 @@ else:
     from . import archipack_truss
     from . import archipack_floor
     from . import archipack_rendering
-
-    # print("archipack: ready")
+    print("archipack: ready")
 
 # noinspection PyUnresolvedReferences
 import bpy
@@ -105,82 +102,110 @@ icons_collection = {}
 # Addon preferences
 # ----------------------------------------------------
 
-def update_panel(self, context):
-    try:
-        bpy.utils.unregister_class(TOOLS_PT_Archipack_Tools)
-        bpy.utils.unregister_class(TOOLS_PT_Archipack_Create)
-    except:
-        pass
-    prefs = context.user_preferences.addons[__name__].preferences
-    TOOLS_PT_Archipack_Tools.bl_category = prefs.tools_category
-    bpy.utils.register_class(TOOLS_PT_Archipack_Tools)
-    TOOLS_PT_Archipack_Create.bl_category = prefs.create_category
-    bpy.utils.register_class(TOOLS_PT_Archipack_Create)
-
 
 class Archipack_Pref(AddonPreferences):
     bl_idname = __name__
 
-    tools_category = StringProperty(
-        name="Tools",
-        description="Choose a name for the category of the Tools panel",
-        default="Tools",
-        update=update_panel
-    )
-    create_category = StringProperty(
-        name="Create",
-        description="Choose a name for the category of the Create panel",
-        default="Create",
-        update=update_panel
-    )
-    create_submenu = BoolProperty(
+    create_submenu : BoolProperty(
         name="Use Sub-menu",
         description="Put Achipack's object into a sub menu (shift+a)",
         default=True
     )
-    max_style_draw_tool = BoolProperty(
+    max_style_draw_tool : BoolProperty(
         name="Draw a wall use 3dsmax style",
         description="Reverse clic / release & drag cycle for Draw a wall",
         default=True
     )
     # Arrow sizes (world units)
-    arrow_size = FloatProperty(
+    arrow_size : FloatProperty(
             name="Arrow",
             description="Manipulators arrow size (blender units)",
             default=0.05
             )
     # Handle area size (pixels)
-    handle_size = IntProperty(
+    handle_size : IntProperty(
             name="Handle",
             description="Manipulators handle sensitive area size (pixels)",
             min=2,
             default=10
             )
-    matlib_path = StringProperty(
+    constant_handle_size: BoolProperty(
+        name="Constant handle size",
+        description="When checked, handle size on scree remains constant (handle size pixels)",
+        default=False
+    )
+    text_size: IntProperty(
+        name="Manipulators",
+        description="Manipulator font size (pixels)",
+        min=2,
+        default=14
+    )
+    handle_colour_selected: FloatVectorProperty(
+        name="Selected handle colour",
+        description="Handle color when selected",
+        subtype='COLOR_GAMMA',
+        default=(0.0, 0.0, 0.7, 1.0),
+        size=4,
+        min=0, max=1
+    )
+    handle_colour_inactive: FloatVectorProperty(
+        name="Inactive handle colour",
+        description="Handle color when disabled",
+        subtype='COLOR_GAMMA',
+        default=(0.3, 0.3, 0.3, 1.0),
+        size=4,
+        min=0, max=1
+    )
+    handle_colour_normal: FloatVectorProperty(
+        name="Handle colour normal",
+        description="Base handle color when not selected",
+        subtype='COLOR_GAMMA',
+        default=(1.0, 1.0, 1.0, 1.0),
+        size=4,
+        min=0, max=1
+    )
+    handle_colour_hover: FloatVectorProperty(
+        name="Handle colour hover",
+        description="Handle color when mouse hover",
+        subtype='COLOR_GAMMA',
+        default=(1.0, 1.0, 0.0, 1.0),
+        size=4,
+        min=0, max=1
+    )
+    handle_colour_active: FloatVectorProperty(
+        name="Handle colour active",
+        description="Handle colour when moving",
+        subtype='COLOR_GAMMA',
+        default=(1.0, 0.0, 0.0, 1.0),
+        size=4,
+        min=0, max=1
+    )
+    matlib_path : StringProperty(
             name="Folder path",
             description="absolute path to material library folder",
-            default=""
+            default="",
+            subtype="DIR_PATH"
             )
     # Font sizes and basic colour scheme
-    feedback_size_main = IntProperty(
+    feedback_size_main : IntProperty(
             name="Main",
             description="Main title font size (pixels)",
             min=2,
             default=16
             )
-    feedback_size_title = IntProperty(
+    feedback_size_title : IntProperty(
             name="Title",
             description="Tool name font size (pixels)",
             min=2,
             default=14
             )
-    feedback_size_shortcut = IntProperty(
+    feedback_size_shortcut : IntProperty(
             name="Shortcut",
             description="Shortcuts font size (pixels)",
             min=2,
             default=11
             )
-    feedback_shortcut_area = FloatVectorProperty(
+    feedback_shortcut_area : FloatVectorProperty(
             name="Background Shortcut",
             description="Shortcut area background color",
             subtype='COLOR_GAMMA',
@@ -188,7 +213,7 @@ class Archipack_Pref(AddonPreferences):
             size=4,
             min=0, max=1
             )
-    feedback_title_area = FloatVectorProperty(
+    feedback_title_area : FloatVectorProperty(
             name="Background Main",
             description="Title area background color",
             subtype='COLOR_GAMMA',
@@ -196,7 +221,7 @@ class Archipack_Pref(AddonPreferences):
             size=4,
             min=0, max=1
             )
-    feedback_colour_main = FloatVectorProperty(
+    feedback_colour_main : FloatVectorProperty(
             name="Font Main",
             description="Title color",
             subtype='COLOR_GAMMA',
@@ -204,7 +229,7 @@ class Archipack_Pref(AddonPreferences):
             size=4,
             min=0, max=1
             )
-    feedback_colour_key = FloatVectorProperty(
+    feedback_colour_key : FloatVectorProperty(
             name="Font Shortcut key",
             description="KEY label color",
             subtype='COLOR_GAMMA',
@@ -212,7 +237,7 @@ class Archipack_Pref(AddonPreferences):
             size=4,
             min=0, max=1
             )
-    feedback_colour_shortcut = FloatVectorProperty(
+    feedback_colour_shortcut : FloatVectorProperty(
             name="Font Shortcut hint",
             description="Shortcuts text color",
             subtype='COLOR_GAMMA',
@@ -226,21 +251,22 @@ class Archipack_Pref(AddonPreferences):
         box = layout.box()
         row = box.row()
         col = row.column()
-        col.label(text="Tab Category:")
-        col.prop(self, "tools_category")
-        col.prop(self, "create_category")
-        col.prop(self, "create_submenu")
-        box = layout.box()
-        box.label("Features")
-        box.prop(self, "max_style_draw_tool")
+        col.label(text="Setup actions")
+        col.prop(self, "matlib_path", text="Material library")
+        box.label(text="Render presets Thumbnails")
+        box.operator("archipack.render_thumbs", icon='ERROR')
         box = layout.box()
         row = box.row()
         col = row.column()
-        col.label(text="Material library:")
-        col.prop(self, "matlib_path")
+        col.label(text="Add menu:")
+        col.prop(self, "create_submenu")
+
+        box = layout.box()
+        box.label(text="Features")
+        box.prop(self, "max_style_draw_tool")
         box = layout.box()
         row = box.row()
-        split = row.split(percentage=0.5)
+        split = row.split(factor=0.5)
         col = split.column()
         col.label(text="Colors:")
         row = col.row(align=True)
@@ -253,6 +279,16 @@ class Archipack_Pref(AddonPreferences):
         row.prop(self, "feedback_colour_key")
         row = col.row(align=True)
         row.prop(self, "feedback_colour_shortcut")
+        row = col.row(align=True)
+        row.prop(self, "handle_colour_normal")
+        row = col.row(align=True)
+        row.prop(self, "handle_colour_hover")
+        row = col.row(align=True)
+        row.prop(self, "handle_colour_active")
+        row = col.row(align=True)
+        row.prop(self, "handle_colour_selected")
+        row = col.row(align=True)
+        row.prop(self, "handle_colour_inactive")
         col = split.column()
         col.label(text="Font size:")
         col.prop(self, "feedback_size_main")
@@ -261,7 +297,8 @@ class Archipack_Pref(AddonPreferences):
         col.label(text="Manipulators:")
         col.prop(self, "arrow_size")
         col.prop(self, "handle_size")
-        # layout.operator("archipack.render_thumbs")
+        col.prop(self, "text_size")
+        col.prop(self, "constant_handle_size")
 
 # ----------------------------------------------------
 # Archipack panels
@@ -273,7 +310,7 @@ class TOOLS_PT_Archipack_Tools(Panel):
     bl_idname = "TOOLS_PT_Archipack_Tools"
     bl_space_type = "VIEW_3D"
     bl_region_type = "TOOLS"
-    bl_category = "Tools"
+    # bl_category = "Tools"
     bl_context = "objectmode"
 
     @classmethod
@@ -284,23 +321,16 @@ class TOOLS_PT_Archipack_Tools(Panel):
         wm = context.window_manager
         layout = self.layout
  

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list