From 55a605dfbe3b2350406cd13e86762a575266e66f Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 19 Nov 2018 15:35:31 +0300 Subject: Rigify: clear RigifyParameters properties when toggling legacy mode. Registering and unregistering the class causes 2.8 to complain about non-annotation properties, and this avoids the problem. Plus, legacy and non-legacy shouldn't interact. --- rigify/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rigify/__init__.py b/rigify/__init__.py index 3c0efdfd..7e0c8ada 100644 --- a/rigify/__init__.py +++ b/rigify/__init__.py @@ -72,6 +72,8 @@ class RigifyPreferences(AddonPreferences): unregister() + clear_rigify_parameters() + globals().pop('utils') globals().pop('rig_lists') globals().pop('generate') @@ -104,6 +106,8 @@ class RigifyPreferences(AddonPreferences): unregister() + clear_rigify_parameters() + globals().pop('utils') globals().pop('rig_lists') globals().pop('generate') @@ -217,6 +221,15 @@ class RigifyParameters(bpy.types.PropertyGroup): name: StringProperty() +# Remember the initial property set +RIGIFY_PARAMETERS_BASE_DIR = set(dir(RigifyParameters)) + +def clear_rigify_parameters(): + for name in list(dir(RigifyParameters)): + if name not in RIGIFY_PARAMETERS_BASE_DIR: + delattr(RigifyParameters, name) + + class RigifyArmatureLayer(bpy.types.PropertyGroup): def get_group(self): -- cgit v1.2.3