Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_undo.c
| Show First 20 Lines • Show All 909 Lines • ▼ Show 20 Lines | static void mesh_undosys_foreach_ID_ref(UndoStep *us_p, | ||||
| MeshUndoStep *us = (MeshUndoStep *)us_p; | MeshUndoStep *us = (MeshUndoStep *)us_p; | ||||
| for (uint i = 0; i < us->elems_len; i++) { | for (uint i = 0; i < us->elems_len; i++) { | ||||
| MeshUndoStep_Elem *elem = &us->elems[i]; | MeshUndoStep_Elem *elem = &us->elems[i]; | ||||
| foreach_ID_ref_fn(user_data, ((UndoRefID *)&elem->obedit_ref)); | foreach_ID_ref_fn(user_data, ((UndoRefID *)&elem->obedit_ref)); | ||||
| } | } | ||||
| } | } | ||||
| /* Export for ED_undo_sys. */ | |||||
| void ED_mesh_undosys_type(UndoType *ut) | void ED_mesh_undosys_type(UndoType *ut) | ||||
| { | { | ||||
| ut->name = "Edit Mesh"; | ut->name = "Edit Mesh"; | ||||
| ut->poll = mesh_undosys_poll; | ut->poll = mesh_undosys_poll; | ||||
| ut->step_encode = mesh_undosys_step_encode; | ut->step_encode = mesh_undosys_step_encode; | ||||
| ut->step_decode = mesh_undosys_step_decode; | ut->step_decode = mesh_undosys_step_decode; | ||||
| ut->step_free = mesh_undosys_step_free; | ut->step_free = mesh_undosys_step_free; | ||||
| ut->step_foreach_ID_ref = mesh_undosys_foreach_ID_ref; | ut->step_foreach_ID_ref = mesh_undosys_foreach_ID_ref; | ||||
| ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; | ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; | ||||
| ut->step_size = sizeof(MeshUndoStep); | ut->step_size = sizeof(MeshUndoStep); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||