void ED_undo_push(bContext *C, const char *str) { wmWindowManager *wm = CTX_wm_manager(C); Object *obedit = CTX_data_edit_object(C); Object *obact = CTX_data_active_object(C); if (G.debug & G_DEBUG) printf("%s: %s\n", __func__, str); if (obedit) { if (U.undosteps == 0) return; if (obedit->type == OB_MESH) undo_push_mesh(C, str); else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) undo_push_curve(C, str); else if (obedit->type == OB_FONT) undo_push_font(C, str); else if (obedit->type == OB_MBALL) undo_push_mball(C, str); else if (obedit->type == OB_LATTICE) undo_push_lattice(C, str); else if (obedit->type == OB_ARMATURE) undo_push_armature(C, str); } else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) { if (U.undosteps == 0) return; PE_undo_push(CTX_data_scene(C), str); } else { BKE_write_undo(C, str); } if (wm->file_saved) { wm->file_saved = 0; /* notifier that data changed, for save-over warning or header */ WM_event_add_notifier(C, NC_WM | ND_DATACHANGED, NULL); } }
void ED_undo_push(bContext *C, const char *str) { wmWindowManager *wm= CTX_wm_manager(C); Object *obedit= CTX_data_edit_object(C); Object *obact= CTX_data_active_object(C); if(obedit) { if (U.undosteps == 0) return; if(obedit->type==OB_MESH) undo_push_mesh(C, str); else if ELEM(obedit->type, OB_CURVE, OB_SURF) undo_push_curve(C, str); else if (obedit->type==OB_FONT) undo_push_font(C, str); else if (obedit->type==OB_MBALL) undo_push_mball(C, str); else if (obedit->type==OB_LATTICE) undo_push_lattice(C, str); else if (obedit->type==OB_ARMATURE) undo_push_armature(C, str); }
void ED_undo_push(bContext *C, const char *str) { Object *obedit = CTX_data_edit_object(C); Object *obact = CTX_data_active_object(C); if (G.debug & G_DEBUG) printf("%s: %s\n", __func__, str); if (obedit) { if (U.undosteps == 0) return; if (obedit->type == OB_MESH) undo_push_mesh(C, str); else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) undo_push_curve(C, str); else if (obedit->type == OB_FONT) undo_push_font(C, str); else if (obedit->type == OB_MBALL) undo_push_mball(C, str); else if (obedit->type == OB_LATTICE) undo_push_lattice(C, str); else if (obedit->type == OB_ARMATURE) undo_push_armature(C, str); } else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) { if (U.undosteps == 0) return; PE_undo_push(CTX_data_scene(C), str); } else if (obact && obact->mode & OB_MODE_SCULPT) { /* do nothing for now */ } else { BKE_undo_write(C, str); } WM_file_tag_modified(C); }