Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_undo.c
| Show First 20 Lines • Show All 1,328 Lines • ▼ Show 20 Lines | else { | ||||
| unode->shapeName[0] = '\0'; | unode->shapeName[0] = '\0'; | ||||
| } | } | ||||
| BLI_thread_unlock(LOCK_CUSTOM1); | BLI_thread_unlock(LOCK_CUSTOM1); | ||||
| return unode; | return unode; | ||||
| } | } | ||||
| void SCULPT_undo_push_begin(const char *name) | void SCULPT_undo_push_begin(Object *ob, const char *name) | ||||
| { | { | ||||
| UndoStack *ustack = ED_undo_stack_get(); | UndoStack *ustack = ED_undo_stack_get(); | ||||
| if (ob != NULL) { | |||||
| /* If possible, we need to tag the object and its geometry data as 'changed in the future' in | |||||
| * the previous undo step if it's a memfile one. */ | |||||
| ED_undosys_stack_memfile_id_changed_tag(ustack, &ob->id); | |||||
| ED_undosys_stack_memfile_id_changed_tag(ustack, ob->data); | |||||
| } | |||||
| /* Special case, we never read from this. */ | /* Special case, we never read from this. */ | ||||
| bContext *C = NULL; | bContext *C = NULL; | ||||
| BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_SCULPT); | BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_SCULPT); | ||||
| } | } | ||||
| void SCULPT_undo_push_end(void) | void SCULPT_undo_push_end(void) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | |||||
| static void sculpt_undosys_step_free(UndoStep *us_p) | static void sculpt_undosys_step_free(UndoStep *us_p) | ||||
| { | { | ||||
| SculptUndoStep *us = (SculptUndoStep *)us_p; | SculptUndoStep *us = (SculptUndoStep *)us_p; | ||||
| sculpt_undo_free_list(&us->data.nodes); | sculpt_undo_free_list(&us->data.nodes); | ||||
| } | } | ||||
| void ED_sculpt_undo_geometry_begin(struct Object *ob, const char *name) | void ED_sculpt_undo_geometry_begin(struct Object *ob, const char *name) | ||||
| { | { | ||||
| SCULPT_undo_push_begin(name); | SCULPT_undo_push_begin(ob, name); | ||||
| SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY); | SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY); | ||||
| } | } | ||||
| void ED_sculpt_undo_geometry_end(struct Object *ob) | void ED_sculpt_undo_geometry_end(struct Object *ob) | ||||
| { | { | ||||
| SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY); | SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY); | ||||
| SCULPT_undo_push_end(); | SCULPT_undo_push_end(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
| void ED_sculpt_undo_push_multires_mesh_begin(bContext *C, const char *str) | void ED_sculpt_undo_push_multires_mesh_begin(bContext *C, const char *str) | ||||
| { | { | ||||
| if (!sculpt_undo_use_multires_mesh(C)) { | if (!sculpt_undo_use_multires_mesh(C)) { | ||||
| return; | return; | ||||
| } | } | ||||
| Object *object = CTX_data_active_object(C); | Object *object = CTX_data_active_object(C); | ||||
| SCULPT_undo_push_begin(str); | SCULPT_undo_push_begin(object, str); | ||||
| SculptUndoNode *geometry_unode = SCULPT_undo_push_node(object, NULL, SCULPT_UNDO_GEOMETRY); | SculptUndoNode *geometry_unode = SCULPT_undo_push_node(object, NULL, SCULPT_UNDO_GEOMETRY); | ||||
| geometry_unode->geometry_clear_pbvh = false; | geometry_unode->geometry_clear_pbvh = false; | ||||
| sculpt_undo_push_all_grids(object); | sculpt_undo_push_all_grids(object); | ||||
| } | } | ||||
| void ED_sculpt_undo_push_multires_mesh_end(bContext *C, const char *str) | void ED_sculpt_undo_push_multires_mesh_end(bContext *C, const char *str) | ||||
| Show All 15 Lines | |||||