From 464aaced76838657f1de24aa305881f165fa0561 Mon Sep 17 00:00:00 2001 From: Ines Almeida Date: Sat, 22 Sep 2018 12:51:12 +0200 Subject: Bone Selection Sets: organize file according to structure --- bone_selection_sets.py | 54 +++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'bone_selection_sets.py') diff --git a/bone_selection_sets.py b/bone_selection_sets.py index fcc4b70c..2bbfa1cd 100644 --- a/bone_selection_sets.py +++ b/bone_selection_sets.py @@ -48,7 +48,7 @@ from bpy.props import ( # Data Structure ############################################################## # Note: bones are stored by name, this means that if the bone is renamed, -# there can be problems. However, bone renaming is unlikely during animation +# there can be problems. However, bone renaming is unlikely during animation. class SelectionEntry(PropertyGroup): name: StringProperty(name="Bone Name") @@ -417,30 +417,7 @@ class POSE_OT_selection_set_paste(PluginOperator): return {'FINISHED'} -# Registry #################################################################### - -classes = ( - POSE_MT_selection_set_create, - POSE_MT_selection_sets_specials, - POSE_MT_selection_sets, - POSE_PT_selection_sets, - POSE_UL_selection_set, - SelectionEntry, - SelectionSet, - POSE_OT_selection_set_delete_all, - POSE_OT_selection_set_remove_bones, - POSE_OT_selection_set_move, - POSE_OT_selection_set_add, - POSE_OT_selection_set_remove, - POSE_OT_selection_set_assign, - POSE_OT_selection_set_unassign, - POSE_OT_selection_set_select, - POSE_OT_selection_set_deselect, - POSE_OT_selection_set_add_and_assign, - POSE_OT_selection_set_copy, - POSE_OT_selection_set_paste, -) - +# Helper Functions ############################################################ def add_sss_button(self, context): self.layout.menu('POSE_MT_selection_sets') @@ -478,6 +455,8 @@ def from_json(context, as_json: str): def uniqify(name: str, other_names: list) -> str: """Return a unique name with .xxx suffix if necessary. + Example usage: + >>> uniqify('hey', ['there']) 'hey' >>> uniqify('hey', ['hey.001', 'hey.005']) @@ -515,6 +494,31 @@ def uniqify(name: str, other_names: list) -> str: return "{}.{:03d}".format(name, min_index) +# Registry #################################################################### + +classes = ( + POSE_MT_selection_set_create, + POSE_MT_selection_sets_specials, + POSE_MT_selection_sets, + POSE_PT_selection_sets, + POSE_UL_selection_set, + SelectionEntry, + SelectionSet, + POSE_OT_selection_set_delete_all, + POSE_OT_selection_set_remove_bones, + POSE_OT_selection_set_move, + POSE_OT_selection_set_add, + POSE_OT_selection_set_remove, + POSE_OT_selection_set_assign, + POSE_OT_selection_set_unassign, + POSE_OT_selection_set_select, + POSE_OT_selection_set_deselect, + POSE_OT_selection_set_add_and_assign, + POSE_OT_selection_set_copy, + POSE_OT_selection_set_paste, +) + + # store keymaps here to access after registration addon_keymaps = [] -- cgit v1.2.3