Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_edge_split.cc
| Show All 33 Lines | |||||
| static Mesh *mesh_edge_split(const Mesh &mesh, const IndexMask selection) | static Mesh *mesh_edge_split(const Mesh &mesh, const IndexMask selection) | ||||
| { | { | ||||
| BMeshCreateParams bmesh_create_params{}; | BMeshCreateParams bmesh_create_params{}; | ||||
| bmesh_create_params.use_toolflags = true; | bmesh_create_params.use_toolflags = true; | ||||
| const BMAllocTemplate allocsize = {0, 0, 0, 0}; | const BMAllocTemplate allocsize = {0, 0, 0, 0}; | ||||
| BMesh *bm = BM_mesh_create(&allocsize, &bmesh_create_params); | BMesh *bm = BM_mesh_create(&allocsize, &bmesh_create_params); | ||||
| BMeshFromMeshParams bmesh_from_mesh_params{}; | BMeshFromMeshParams bmesh_from_mesh_params{}; | ||||
| bmesh_from_mesh_params.cd_mask_extra.vmask = CD_MASK_ORIGINDEX; | |||||
| bmesh_from_mesh_params.cd_mask_extra.emask = CD_MASK_ORIGINDEX; | |||||
| bmesh_from_mesh_params.cd_mask_extra.pmask = CD_MASK_ORIGINDEX; | |||||
HooglyBoogly: This could be committed separately, since it's a problem on the other side of the conversion… | |||||
| BM_mesh_bm_from_me(bm, &mesh, &bmesh_from_mesh_params); | BM_mesh_bm_from_me(bm, &mesh, &bmesh_from_mesh_params); | ||||
| BM_mesh_elem_table_ensure(bm, BM_EDGE); | BM_mesh_elem_table_ensure(bm, BM_EDGE); | ||||
| for (const int i : selection) { | for (const int i : selection) { | ||||
| BMEdge *edge = BM_edge_at_index(bm, i); | BMEdge *edge = BM_edge_at_index(bm, i); | ||||
| BM_elem_flag_enable(edge, BM_ELEM_TAG); | BM_elem_flag_enable(edge, BM_ELEM_TAG); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||
This could be committed separately, since it's a problem on the other side of the conversion (mesh to BMesh).
I wanted to keep it in the patch to add some context though.
Here, the process is totally correct if the BMesh is created with any existing orig index layers, which will still be transferred to the result.
What was not correct is that later on, BKE_mesh_from_bmesh_for_eval_nomain would make up its own orig indices.