[Bf-blender-cvs] [1ff5cc8c1ac] blender2.8: addons: disable addons with versions below 2.8

Campbell Barton noreply at git.blender.org
Tue Jul 3 08:06:06 CEST 2018


Commit: 1ff5cc8c1ac7e4262b131a63c7e0fbb7d4fa8a8d
Author: Campbell Barton
Date:   Tue Jul 3 07:58:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB1ff5cc8c1ac7e4262b131a63c7e0fbb7d4fa8a8d

addons: disable addons with versions below 2.8

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

M	release/scripts/modules/addon_utils.py
M	release/scripts/startup/bl_ui/space_userpref.py

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

diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 1b6dae68684..c96acb002af 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -351,6 +351,16 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non
                 _addon_remove(module_name)
             return None
 
+        # 1.1) fail when add-on is too old
+        # This is a temporary 2.8x migration check, so we can manage addons that are supported.
+        try:
+            print(mod.bl_info.get("blender", (0, 0, 0)))
+            if mod.bl_info.get("blender", (0, 0, 0)) < (2, 80, 0):
+                raise Exception(f"Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
+        except Exception as ex:
+            handle_error(ex)
+            return None
+
         # 2) try register collected modules
         # removed, addons need to handle own registration now.
 
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 4ce14f5ac89..1f00f8af1ff 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1473,7 +1473,15 @@ class USERPREF_PT_addons(Panel):
                 sub = row.row()
                 sub.active = is_enabled
                 sub.label(text="%s: %s" % (info["category"], info["name"]))
-                if info["warning"]:
+
+
+                # WARNING: 2.8x exception, may be removed
+                # use disabled state for old add-ons, chances are they are broken.
+                if info.get("blender", (0,)) < (2, 80):
+                    sub.label(text="upgrade to 2.8x required")
+                    sub.label(icon='ERROR')
+                # Remove code above after 2.8x migration is complete.
+                elif info["warning"]:
                     sub.label(icon='ERROR')
 
                 # icon showing support level.



More information about the Bf-blender-cvs mailing list