Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_tools.c
| Show First 20 Lines • Show All 3,702 Lines • ▼ Show 20 Lines | static Base *mesh_separate_tagged(Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_old, BMesh *bm_old) | ||||
| Object *obedit = base_old->object; | Object *obedit = base_old->object; | ||||
| BMesh *bm_new; | BMesh *bm_new; | ||||
| bm_new = BM_mesh_create( | bm_new = BM_mesh_create( | ||||
| &bm_mesh_allocsize_default, | &bm_mesh_allocsize_default, | ||||
| &((struct BMeshCreateParams){.use_toolflags = true,})); | &((struct BMeshCreateParams){.use_toolflags = true,})); | ||||
| BM_mesh_elem_toolflags_ensure(bm_new); /* needed for 'duplicate' bmo */ | BM_mesh_elem_toolflags_ensure(bm_new); /* needed for 'duplicate' bmo */ | ||||
| CustomData_copy(&bm_old->vdata, &bm_new->vdata, CD_MASK_BMESH, CD_CALLOC, 0); | CustomData_copy(&bm_old->vdata, &bm_new->vdata, CD_MASK_BMESH.vmask, CD_CALLOC, 0); | ||||
| CustomData_copy(&bm_old->edata, &bm_new->edata, CD_MASK_BMESH, CD_CALLOC, 0); | CustomData_copy(&bm_old->edata, &bm_new->edata, CD_MASK_BMESH.emask, CD_CALLOC, 0); | ||||
| CustomData_copy(&bm_old->ldata, &bm_new->ldata, CD_MASK_BMESH, CD_CALLOC, 0); | CustomData_copy(&bm_old->ldata, &bm_new->ldata, CD_MASK_BMESH.lmask, CD_CALLOC, 0); | ||||
| CustomData_copy(&bm_old->pdata, &bm_new->pdata, CD_MASK_BMESH, CD_CALLOC, 0); | CustomData_copy(&bm_old->pdata, &bm_new->pdata, CD_MASK_BMESH.pmask, CD_CALLOC, 0); | ||||
| CustomData_bmesh_init_pool(&bm_new->vdata, bm_mesh_allocsize_default.totvert, BM_VERT); | CustomData_bmesh_init_pool(&bm_new->vdata, bm_mesh_allocsize_default.totvert, BM_VERT); | ||||
| CustomData_bmesh_init_pool(&bm_new->edata, bm_mesh_allocsize_default.totedge, BM_EDGE); | CustomData_bmesh_init_pool(&bm_new->edata, bm_mesh_allocsize_default.totedge, BM_EDGE); | ||||
| CustomData_bmesh_init_pool(&bm_new->ldata, bm_mesh_allocsize_default.totloop, BM_LOOP); | CustomData_bmesh_init_pool(&bm_new->ldata, bm_mesh_allocsize_default.totloop, BM_LOOP); | ||||
| CustomData_bmesh_init_pool(&bm_new->pdata, bm_mesh_allocsize_default.totface, BM_FACE); | CustomData_bmesh_init_pool(&bm_new->pdata, bm_mesh_allocsize_default.totface, BM_FACE); | ||||
| base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, USER_DUP_MESH); | base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, USER_DUP_MESH); | ||||
| ▲ Show 20 Lines • Show All 4,690 Lines • Show Last 20 Lines | |||||