2.5/Sculpt:
[blender.git] / source / blender / editors / object / object_edit.c
index 7d00884760233900f497680075329301891344d9..188d0d8e915ecbca2b6ebdd4fba82a54d19d3b8f 100644 (file)
@@ -3740,7 +3740,7 @@ void ED_object_exit_editmode(bContext *C, int flag)
                WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene);
        }
 
-       ED_view3d_restore_paint_modes(C, obedit->restore_mode);
+       ED_object_toggle_modes(C, obedit->restore_mode);
 }
 
 
@@ -3774,7 +3774,9 @@ void ED_object_enter_editmode(bContext *C, int flag)
        
        if(flag & EM_WAITCURSOR) waitcursor(1);
 
-       ob->restore_mode = ED_view3d_exit_paint_modes(C);
+       ob->restore_mode = ob->mode;
+       ED_view3d_exit_paint_modes(C);
+       ED_object_toggle_modes(C, ob->mode);
        
        if(ob->type==OB_MESH) {
                Mesh *me= ob->data;
@@ -7034,3 +7036,9 @@ void hookmenu(Scene *scene, View3D *v3d)
        if (changed) {
        }       
 }
+
+void ED_object_toggle_modes(bContext *C, int mode)
+{
+       if(mode & OB_MODE_SCULPT)
+               WM_operator_name_call(C, "SCULPT_OT_sculptmode_toggle", WM_OP_EXEC_REGION_WIN, NULL);
+}