[Bf-blender-cvs] [ec3cd8d400e] soc-2019-outliner: Outliner: Fix selection syncing for edit bones

Nathan Craddock noreply at git.blender.org
Wed Aug 14 05:20:15 CEST 2019


Commit: ec3cd8d400e0c270ceccd740b9d137b8ca850e25
Author: Nathan Craddock
Date:   Tue Aug 13 21:19:46 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBec3cd8d400e0c270ceccd740b9d137b8ca850e25

Outliner: Fix selection syncing for edit bones

Fixes selection syncing from outliner for edit bones not tagging
for updates.

===================================================================

M	source/blender/editors/space_outliner/outliner_sync.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index 3f9988af3f7..bae19aa751c 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -258,13 +258,16 @@ static void outliner_select_sync_to_object(ViewLayer *view_layer,
   }
 }
 
-static void outliner_select_sync_to_edit_bone(TreeElement *te,
+static void outliner_select_sync_to_edit_bone(ViewLayer *view_layer,
+                                              TreeElement *te,
                                               TreeStoreElem *tselem,
                                               ListBase *selected_ebones)
 {
   bArmature *arm = (bArmature *)tselem->id;
   EditBone *ebone = (EditBone *)te->directdata;
 
+  short bone_flag = ebone->flag;
+
   if (EBONE_SELECTABLE(arm, ebone)) {
     if (tselem->flag & TSE_SELECTED) {
       ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
@@ -275,6 +278,13 @@ static void outliner_select_sync_to_edit_bone(TreeElement *te,
       ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
     }
   }
+
+  /* Tag if selection changed */
+  if (bone_flag != ebone->flag) {
+    Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
+    DEG_id_tag_update(&arm->id, ID_RECALC_SELECT);
+    WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, obedit);
+  }
 }
 
 static void outliner_select_sync_to_pose_bone(TreeElement *te,
@@ -339,7 +349,7 @@ static void outliner_sync_selection_from_outliner(Scene *scene,
     }
     else if (tselem->type == TSE_EBONE) {
       if (sync_types->edit_bone) {
-        outliner_select_sync_to_edit_bone(te, tselem, selected_items->edit_bones);
+        outliner_select_sync_to_edit_bone(view_layer, te, tselem, selected_items->edit_bones);
       }
     }
     else if (tselem->type == TSE_POSE_CHANNEL) {



More information about the Bf-blender-cvs mailing list