diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-19 15:35:31 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-19 15:35:31 +0300 |
commit | 55a605dfbe3b2350406cd13e86762a575266e66f (patch) | |
tree | e7dc6f665bb755d013ccfd27da363767c7d7badb /rigify/__init__.py | |
parent | 489e566047d8dab906ceceec4e73ab3d59f9830c (diff) |
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.
Diffstat (limited to 'rigify/__init__.py')
-rw-r--r-- | rigify/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
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): |