Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-10-30 12:56:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-10-30 12:56:55 +0300
commit08d40ecbd8c3a50438f6fea67a77a62a78adda48 (patch)
treebfdcd6ff0ee8f0231999e2da5c05cf4b79985a9e /source/blender/editors/space_outliner/outliner_select.c
parent62b68745fd494e004951c1f45a216b592d89789b (diff)
parent9ab4536218d742351095181bb3f93d24491e6380 (diff)
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_select.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 2e63b3d405e..acdedf8a238 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -87,6 +87,8 @@
/**
* \note changes to selection are by convention and not essential.
+ *
+ * \note Handles own undo push.
*/
static void do_outliner_item_editmode_toggle(bContext *C, Scene *scene, Base *base)
{
@@ -112,11 +114,14 @@ static void do_outliner_item_editmode_toggle(bContext *C, Scene *scene, Base *ba
if (changed) {
DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
ED_outliner_select_sync_from_object_tag(C);
+ ED_undo_push(C, "Outliner Edit Mode Toggle");
}
}
/**
* \note changes to selection are by convention and not essential.
+ *
+ * \note Handles own undo push.
*/
static void do_outliner_item_posemode_toggle(bContext *C, Scene *scene, Base *base)
{
@@ -147,6 +152,7 @@ static void do_outliner_item_posemode_toggle(bContext *C, Scene *scene, Base *ba
if (changed) {
DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
ED_outliner_select_sync_from_object_tag(C);
+ ED_undo_push(C, "Outliner Pose Mode Toggle");
}
}
@@ -158,10 +164,13 @@ static void do_outliner_item_posemode_toggle(bContext *C, Scene *scene, Base *ba
*
* If we didn't want to touch selection we could add an option to the operators
* not to do multi-object editing.
+ *
+ * \note Handles own undo push.
*/
static void do_outliner_item_mode_toggle_generic(bContext *C, TreeViewContext *tvc, Base *base)
{
const int active_mode = tvc->obact->mode;
+ ED_undo_group_begin(C);
if (ED_object_mode_set(C, OB_MODE_OBJECT)) {
Base *base_active = BKE_view_layer_base_find(tvc->view_layer, tvc->obact);
@@ -169,13 +178,14 @@ static void do_outliner_item_mode_toggle_generic(bContext *C, TreeViewContext *t
BKE_view_layer_base_deselect_all(tvc->view_layer);
BKE_view_layer_base_select_and_set_active(tvc->view_layer, base);
DEG_id_tag_update(&tvc->scene->id, ID_RECALC_SELECT);
+ ED_undo_push(C, "Change Active");
- /* XXX: Must add undo step between activation and setting mode to prevent an assert. */
- ED_undo_push(C, "outliner mode toggle");
+ /* Operator call does undo push. */
ED_object_mode_set(C, active_mode);
ED_outliner_select_sync_from_object_tag(C);
}
}
+ ED_undo_group_end(C);
}
/* Toggle the item's interaction mode if supported */