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>2010-01-30 19:09:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-30 19:09:56 +0300
commit29377db3f1c427d50031a479b2c082a47c6ac163 (patch)
tree335180d00768dd48a72c68f00bc4e666f73874ed /source/blender/editors
parentd4663166d6c4703d38302a2a80e1d327ff806ab7 (diff)
[#19872] Mesh edit missing undo push for mode changing
copy the editmesh select mode back to the scene on undo.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/ED_mesh.h1
-rw-r--r--source/blender/editors/mesh/editmesh_lib.c5
-rw-r--r--source/blender/editors/util/editmode_undo.c5
3 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 04affbac803..1e0dd78e392 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -133,6 +133,7 @@ void EM_selectmode_set(struct EditMesh *em);
void EM_select_flush(struct EditMesh *em);
void EM_convertsel(struct EditMesh *em, short oldmode, short selectmode);
void EM_validate_selections(struct EditMesh *em);
+void EM_selectmode_to_scene(struct Scene *scene, struct Object *obedit);
/* exported to transform */
int EM_get_actSelection(struct EditMesh *em, struct EditSelection *ese);
diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c
index b3e96729201..a5ce4ee5dcd 100644
--- a/source/blender/editors/mesh/editmesh_lib.c
+++ b/source/blender/editors/mesh/editmesh_lib.c
@@ -743,6 +743,11 @@ void EM_convertsel(EditMesh *em, short oldmode, short selectmode)
EM_nfaces_selected(em);
}
+void EM_selectmode_to_scene(struct Scene *scene, struct Object *obedit)
+{
+ scene->toolsettings->selectmode= get_mesh(obedit)->edit_mesh->selectmode;
+}
+
/* when switching select mode, makes sure selection is consistent for editing */
/* also for paranoia checks to make sure edge or face mode works */
void EM_selectmode_set(EditMesh *em)
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index a21ff088f2e..f58cd148dec 100644
--- a/source/blender/editors/util/editmode_undo.c
+++ b/source/blender/editors/util/editmode_undo.c
@@ -269,6 +269,11 @@ void undo_editmode_step(bContext *C, int step)
}
}
+ /* special case for editmesh, mode must be copied back to the scene */
+ if(obedit->type == OB_MESH) {
+ EM_selectmode_to_scene(CTX_data_scene(C), obedit);
+ }
+
DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
/* XXX notifiers */