Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_undo.c
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_ccg.h" | #include "BKE_ccg.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_customdata.h" | #include "BKE_customdata.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_mesh_runtime.h" | |||||
| #include "BKE_multires.h" | #include "BKE_multires.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_subdiv_ccg.h" | #include "BKE_subdiv_ccg.h" | ||||
| #include "BKE_subsurf.h" | #include "BKE_subsurf.h" | ||||
| #include "BKE_undo_system.h" | #include "BKE_undo_system.h" | ||||
| ▲ Show 20 Lines • Show All 484 Lines • ▼ Show 20 Lines | static void sculpt_undo_geometry_restore_data(SculptUndoNodeGeometry *geometry, Object *object) | ||||
| CustomData_copy( | CustomData_copy( | ||||
| &geometry->edata, &mesh->edata, CD_MASK_MESH.emask, CD_DUPLICATE, geometry->totedge); | &geometry->edata, &mesh->edata, CD_MASK_MESH.emask, CD_DUPLICATE, geometry->totedge); | ||||
| CustomData_copy( | CustomData_copy( | ||||
| &geometry->ldata, &mesh->ldata, CD_MASK_MESH.lmask, CD_DUPLICATE, geometry->totloop); | &geometry->ldata, &mesh->ldata, CD_MASK_MESH.lmask, CD_DUPLICATE, geometry->totloop); | ||||
| CustomData_copy( | CustomData_copy( | ||||
| &geometry->pdata, &mesh->pdata, CD_MASK_MESH.pmask, CD_DUPLICATE, geometry->totpoly); | &geometry->pdata, &mesh->pdata, CD_MASK_MESH.pmask, CD_DUPLICATE, geometry->totpoly); | ||||
| BKE_mesh_update_customdata_pointers(mesh, false); | BKE_mesh_update_customdata_pointers(mesh, false); | ||||
| BKE_mesh_runtime_clear_cache(mesh); | |||||
| } | } | ||||
| static void sculpt_undo_geometry_free_data(SculptUndoNodeGeometry *geometry) | static void sculpt_undo_geometry_free_data(SculptUndoNodeGeometry *geometry) | ||||
| { | { | ||||
| if (geometry->totvert) { | if (geometry->totvert) { | ||||
| CustomData_free(&geometry->vdata, geometry->totvert); | CustomData_free(&geometry->vdata, geometry->totvert); | ||||
| } | } | ||||
| if (geometry->totedge) { | if (geometry->totedge) { | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||