From acdd4b804b8c1e2e473867ec95336a54a745c0e0 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Tue, 23 May 2023 17:55:20 +0200 Subject: [PATCH] Rigify: add a warning if feature set requires newer Blender version Users often install a Rigify feature set that was created for a newer version of Blender. This is a source of frustration and bug reports. This commit adds a basic warning to the feature set panel if the active feature set was meant to be used with a newer Blender version. Alleviates #97622. --- rigify/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rigify/__init__.py b/rigify/__init__.py index bf0a6bc89..1b31a2fd9 100644 --- a/rigify/__init__.py +++ b/rigify/__init__.py @@ -4,7 +4,7 @@ bl_info = { "name": "Rigify", - "version": (0, 6, 8), + "version": (0, 6, 9), "author": "Nathan Vegdahl, Lucio Rossi, Ivan Cappiello, Alexander Gavrilov", # noqa "blender": (4, 0, 0), "description": "Automatic rigging from building-block components", @@ -18,6 +18,8 @@ import sys import bpy import typing +from bpy.app.translations import pgettext_iface as iface_ + # The order in which core modules of the addon are loaded and reloaded. # Modules not in this list are removed from memory upon reload. @@ -289,6 +291,16 @@ def draw_feature_set_prefs(layout: bpy.types.UILayout, _context, feature_set: Ri split = col.row().split(factor=split_factor) split.label(text="Version:") split.label(text=".".join(str(x) for x in info['version']), translate=False) + if 'blender' in info and info['blender'] > bpy.app.version: + split = col.row().split(factor=split_factor) + split.label(text="Warning:") + sub = split.row() + sub.alert = True + sub.label(text=( + iface_("This feature set requires Blender %s or newer to work properly. " + "Expect errors.") % ".".join(str(x) for x in info['blender']) + ), + icon='ERROR', translate=False) if 'warning' in info: split = col.row().split(factor=split_factor) split.label(text="Warning:") -- 2.30.2