From 1be0b3210d8a3a30e99a853b50703a7ca7e8ac1e Mon Sep 17 00:00:00 2001
From: Demeter Dzadik <Mets>
Date: Mon, 21 Sep 2020 17:59:13 +0200
Subject: [PATCH] Bone Selection Sets: USE_INSERTION on CollectionProperties

Use the new 'USE_INSERTION' override flag (rBdb314ee7a472) to allow creating new entries of Selection Sets on overridden rigs. I tested including saving and reloading, assigning and removing bones from a set:

- Can create and name new, local sets
- Can add and remove bones to and from those local sets
- Can add bones to original, non-local sets and remove those same bones
- Can NOT remove original sets
- Can NOT remove originally assigned bones bones from originally existing sets

To me this all seems to be working as intended, so might as well use it!

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D8971
---
 bone_selection_sets.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bone_selection_sets.py b/bone_selection_sets.py
index 86338da2b..563a4d9dc 100644
--- a/bone_selection_sets.py
+++ b/bone_selection_sets.py
@@ -55,7 +55,10 @@ class SelectionEntry(PropertyGroup):
 
 class SelectionSet(PropertyGroup):
     name: StringProperty(name="Set Name", override={'LIBRARY_OVERRIDABLE'})
-    bone_ids: CollectionProperty(type=SelectionEntry, override={'LIBRARY_OVERRIDABLE'})
+    bone_ids: CollectionProperty(
+        type=SelectionEntry, 
+        override={'LIBRARY_OVERRIDABLE', 'USE_INSERTION'}
+    )  
     is_selected: BoolProperty(name="Is Selected", override={'LIBRARY_OVERRIDABLE'})
 
 
@@ -546,7 +549,7 @@ def register():
         type=SelectionSet,
         name="Selection Sets",
         description="List of groups of bones for easy selection",
-        override={'LIBRARY_OVERRIDABLE'}
+        override={'LIBRARY_OVERRIDABLE', 'USE_INSERTION'}
     )
     bpy.types.Object.active_selection_set = IntProperty(
         name="Active Selection Set",
-- 
GitLab