Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_mask_extract.c
| Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | static int geometry_extract_apply(bContext *C, | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C); | Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C); | ||||
| ED_object_sculptmode_exit(C, depsgraph); | ED_object_sculptmode_exit(C, depsgraph); | ||||
| BKE_sculpt_mask_layers_ensure(ob, NULL); | BKE_sculpt_mask_layers_ensure(ob, NULL); | ||||
| /* Ensures that deformation from sculpt mode is taken into accunt before duplicating the mesh to | |||||
| * extract the geometry. */ | |||||
| CTX_data_ensure_evaluated_depsgraph(C); | |||||
| Mesh *mesh = ob->data; | Mesh *mesh = ob->data; | ||||
| Mesh *new_mesh = (Mesh *)BKE_id_copy(bmain, &mesh->id); | Mesh *new_mesh = (Mesh *)BKE_id_copy(bmain, &mesh->id); | ||||
| const BMAllocTemplate allocsize = BMALLOC_TEMPLATE_FROM_ME(new_mesh); | const BMAllocTemplate allocsize = BMALLOC_TEMPLATE_FROM_ME(new_mesh); | ||||
| BMesh *bm; | BMesh *bm; | ||||
| bm = BM_mesh_create(&allocsize, | bm = BM_mesh_create(&allocsize, | ||||
| &((struct BMeshCreateParams){ | &((struct BMeshCreateParams){ | ||||
| .use_toolflags = true, | .use_toolflags = true, | ||||
| ▲ Show 20 Lines • Show All 512 Lines • Show Last 20 Lines | |||||