Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-05-28 22:57:36 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-05-29 10:37:28 +0300
commit011f7afde41efc6fa16084e0f406f5287dc3c481 (patch)
tree3151da38ff4fffcd11483186af24cbcc400be4a1 /rigify/ui.py
parent68bb42ef065c5c95a21493ebd5469b8a21af75ae (diff)
Rigify: refactor feature sets to avoid modifying global path.
Instead of adding the feature set installation directory to the global path, and thus inserting the modules into the top level namespace, add an empty rigify.feature_sets package and use __path__ to redirect the module loader to read its sub-modules from the feature set directory. Now feature set modules are effectively installed into that package and loaded as 'rigify.feature_sets.foo'. As an aside, clean up loading code to avoid weird path manipulations, add more safety checks when installing sets, and add a way for sets to expose a user-friendly name.
Diffstat (limited to 'rigify/ui.py')
-rw-r--r--rigify/ui.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/rigify/ui.py b/rigify/ui.py
index 48f34e0e..35b9c847 100644
--- a/rigify/ui.py
+++ b/rigify/ui.py
@@ -38,7 +38,7 @@ from .rigs.utils import get_limb_generated_names
from . import rig_lists
from . import generate
from . import rot_mode
-from . import feature_sets
+from . import feature_set_list
def build_type_list(context, rigify_types):
@@ -46,7 +46,7 @@ def build_type_list(context, rigify_types):
for r in sorted(rig_lists.rigs):
if (context.object.data.active_feature_set in ('all', rig_lists.rigs[r]['feature_set'])
- or len(feature_sets.feature_set_items(context.scene, context)) == 2
+ or len(feature_set_list.feature_set_items(context.scene, context)) == 2
):
a = rigify_types.add()
a.name = r
@@ -185,7 +185,7 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
id_store.rigify_active_type = 0
# Rig type list
- if len(feature_sets.feature_set_items(context.scene, context)) > 2:
+ if len(feature_set_list.feature_set_items(context.scene, context)) > 2:
row = layout.row()
row.prop(context.object.data, "active_feature_set")
row = layout.row()
@@ -598,7 +598,7 @@ class BONE_PT_rigify_buttons(bpy.types.Panel):
build_type_list(context, id_store.rigify_types)
# Rig type field
- if len(feature_sets.feature_set_items(context.scene, context)) > 2:
+ if len(feature_set_list.feature_set_items(context.scene, context)) > 2:
row = layout.row()
row.prop(context.object.data, "active_feature_set")
row = layout.row()