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:
authorInes Almeida <britalmeida@gmail.com>2018-09-22 13:51:12 +0300
committerInes Almeida <britalmeida@gmail.com>2018-09-22 13:51:12 +0300
commit464aaced76838657f1de24aa305881f165fa0561 (patch)
tree980aad169e1aaac7b0bb3595e14f7b3b9d9bd4f2 /bone_selection_sets.py
parent4101cb5d5aada3ec81ce6c1ce05f715cc1cf801b (diff)
Bone Selection Sets: organize file according to structure
Diffstat (limited to 'bone_selection_sets.py')
-rw-r--r--bone_selection_sets.py54
1 files changed, 29 insertions, 25 deletions
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 = []