diff options
author | Demeter Dzadik <Mets> | 2020-11-08 07:31:13 +0300 |
---|---|---|
committer | Demeter Dzadik <demeterdzadik@gmail.com> | 2020-11-08 07:31:32 +0300 |
commit | fa9e1d797972ae7a13bd6dc7849625c24fcf108a (patch) | |
tree | b5c0815513ed7d35f8809b759be61a017bfa521a /rigify/feature_set_list.py | |
parent | 7ab48791aafcfb705b54d6dff44004d2edef6a8d (diff) |
Rigify: Addon Prefs & Feature Sets UI
This patch removes the two drop-down menus from the Rigify addon preferences, replacing it with a checkbox and a UIList.
Before:
{F8766280}
After:
{F8791382}
There is also a small bit of new functionality. The following keys are now recognized in the rigify_info dictionary, similar to Blender addons:
`'link', 'doc_url', 'tracker_url', 'description', 'author', 'version', 'warning'.`
They will be displayed underneath the UIList when the feature set is the active one in the list.
**Ideas for future**
I think this UI better enables us to do some cool things in the future:
- Disable feature sets without uninstalling them.
- Have a base set of feature sets in the list that aren't actually installed. Instead, selecting them would just reveal a button that opens their repository URL. This could be used for officially supported but external feature sets, such as what Legacy should be.
Feedback welcome.
Reviewed By: angavrilov
Differential Revision: https://developer.blender.org/D8519
Diffstat (limited to 'rigify/feature_set_list.py')
-rw-r--r-- | rigify/feature_set_list.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rigify/feature_set_list.py b/rigify/feature_set_list.py index 0204f86a..a50bd010 100644 --- a/rigify/feature_set_list.py +++ b/rigify/feature_set_list.py @@ -220,9 +220,11 @@ class DATA_OT_rigify_add_feature_set(bpy.types.Operator): # Call the register callback of the new set call_register_function(fixed_dirname, True) - addon_prefs.machin = bpy.props.EnumProperty(items=(('a',)*3, ('b',)*3, ('c',)*3),) + addon_prefs.update_external_rigs() + + new_index = addon_prefs.rigify_feature_sets.find(get_ui_name(fixed_dirname)) + addon_prefs.active_feature_set_index = new_index - addon_prefs.update_external_rigs() return {'FINISHED'} @@ -254,8 +256,11 @@ class DATA_OT_rigify_remove_feature_set(bpy.types.Operator): rmtree(set_path) addon_prefs.update_external_rigs(force=True) + addon_prefs.active_feature_set_index = 0 + return {'FINISHED'} + def register(): bpy.utils.register_class(DATA_OT_rigify_add_feature_set) bpy.utils.register_class(DATA_OT_rigify_remove_feature_set) |