Revision: 26438
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26438
Author:   campbellbarton
Date:     2010-01-30 17:09:56 +0100 (Sat, 30 Jan 2010)

Log Message:
-----------
[#19872] Mesh edit missing undo push for mode changing
copy the editmesh select mode back to the scene on undo.        

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/ED_mesh.h
    trunk/blender/source/blender/editors/mesh/editmesh_lib.c
    trunk/blender/source/blender/editors/util/editmode_undo.c

Modified: trunk/blender/source/blender/editors/include/ED_mesh.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_mesh.h      2010-01-30 
15:44:11 UTC (rev 26437)
+++ trunk/blender/source/blender/editors/include/ED_mesh.h      2010-01-30 
16:09:56 UTC (rev 26438)
@@ -133,6 +133,7 @@
 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);

Modified: trunk/blender/source/blender/editors/mesh/editmesh_lib.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_lib.c    2010-01-30 
15:44:11 UTC (rev 26437)
+++ trunk/blender/source/blender/editors/mesh/editmesh_lib.c    2010-01-30 
16:09:56 UTC (rev 26438)
@@ -743,6 +743,11 @@
        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)

Modified: trunk/blender/source/blender/editors/util/editmode_undo.c
===================================================================
--- trunk/blender/source/blender/editors/util/editmode_undo.c   2010-01-30 
15:44:11 UTC (rev 26437)
+++ trunk/blender/source/blender/editors/util/editmode_undo.c   2010-01-30 
16:09:56 UTC (rev 26438)
@@ -269,6 +269,11 @@
                }
        }
        
+       /* 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 */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to