[Bf-blender-cvs] [0b2e0877de9] master: Outliner: sync selection on undo/redo

Nathan Craddock noreply at git.blender.org
Mon Aug 19 17:01:18 CEST 2019


Commit: 0b2e0877de97c79dfe0579f175f29c615a914140
Author: Nathan Craddock
Date:   Mon Aug 19 08:58:13 2019 -0600
Branches: master
https://developer.blender.org/rB0b2e0877de97c79dfe0579f175f29c615a914140

Outliner: sync selection on undo/redo

Tags all outliner sync types on undo and redo operations.

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

M	source/blender/editors/include/ED_outliner.h
M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/editors/space_outliner/outliner_sync.c
M	source/blender/editors/undo/ed_undo.c

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

diff --git a/source/blender/editors/include/ED_outliner.h b/source/blender/editors/include/ED_outliner.h
index 30e2624604c..3015d8d9cdc 100644
--- a/source/blender/editors/include/ED_outliner.h
+++ b/source/blender/editors/include/ED_outliner.h
@@ -36,6 +36,7 @@ void ED_outliner_select_sync_from_object_tag(struct bContext *C);
 void ED_outliner_select_sync_from_edit_bone_tag(struct bContext *C);
 void ED_outliner_select_sync_from_pose_bone_tag(struct bContext *C);
 void ED_outliner_select_sync_from_sequence_tag(struct bContext *C);
+void ED_outliner_select_sync_from_all_tag(struct bContext *C);
 
 bool ED_outliner_select_sync_is_dirty(const struct bContext *C);
 
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 19fd4511e50..75219e6624f 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1398,7 +1398,6 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
     else {
       ED_region_tag_redraw_no_rebuild(ar);
     }
-    ED_undo_push(C, "Outliner selection change");
 
     if (soops->flag & SO_SYNC_SELECT) {
       ED_outliner_select_sync_from_outliner(C, soops);
@@ -1427,6 +1426,8 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
 
   ot->poll = ED_operator_outliner_active;
 
+  ot->flag |= OPTYPE_REGISTER | OPTYPE_UNDO;
+
   PropertyRNA *prop;
   RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection for activation");
   prop = RNA_def_boolean(
@@ -1767,6 +1768,8 @@ void OUTLINER_OT_select_walk(wmOperatorType *ot)
   ot->invoke = outliner_walk_select_invoke;
   ot->poll = ED_operator_outliner_active;
 
+  ot->flag |= OPTYPE_REGISTER | OPTYPE_UNDO;
+
   /* properties */
   PropertyRNA *prop;
   prop = RNA_def_enum(ot->srna,
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index a8aeb7ea4e1..cf734526958 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -75,6 +75,12 @@ void ED_outliner_select_sync_from_sequence_tag(bContext *C)
   wm->outliner_sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE;
 }
 
+void ED_outliner_select_sync_from_all_tag(bContext *C)
+{
+  wmWindowManager *wm = CTX_wm_manager(C);
+  wm->outliner_sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
+}
+
 bool ED_outliner_select_sync_is_dirty(const bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index c84d7539cce..e0f4d1cf465 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -53,6 +53,7 @@
 #include "ED_gpencil.h"
 #include "ED_render.h"
 #include "ED_object.h"
+#include "ED_outliner.h"
 #include "ED_screen.h"
 #include "ED_undo.h"
 
@@ -390,6 +391,8 @@ static int ed_undo_exec(bContext *C, wmOperator *op)
     /* Keep button under the cursor active. */
     WM_event_add_mousemove(C);
   }
+
+  ED_outliner_select_sync_from_all_tag(C);
   return ret;
 }
 
@@ -417,6 +420,8 @@ static int ed_redo_exec(bContext *C, wmOperator *op)
     /* Keep button under the cursor active. */
     WM_event_add_mousemove(C);
   }
+
+  ED_outliner_select_sync_from_all_tag(C);
   return ret;
 }



More information about the Bf-blender-cvs mailing list