Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_boolean_convert.cc
| Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | if (r_orig_mesh) { | ||||
| *r_orig_mesh = me; | *r_orig_mesh = me; | ||||
| } | } | ||||
| if (r_index_in_orig_mesh) { | if (r_index_in_orig_mesh) { | ||||
| *r_index_in_orig_mesh = index_in_mesh; | *r_index_in_orig_mesh = index_in_mesh; | ||||
| } | } | ||||
| return medge; | return medge; | ||||
| } | } | ||||
| /** Convert all of the meshes in `meshes` to an `IMesh` and return that. | /** | ||||
| * Convert all of the meshes in `meshes` to an `IMesh` and return that. | |||||
| * All of the coordinates are transformed into the local space of the | * All of the coordinates are transformed into the local space of the | ||||
| * first Mesh. To do this transformation, we also need the transformation | * first Mesh. To do this transformation, we also need the transformation | ||||
| * obmats corresponding to the Meshes, so they are in the `obmats` argument. | * obmats corresponding to the Meshes, so they are in the `obmats` argument. | ||||
| * The 'original' indexes in the IMesh are the indexes you get by | * The 'original' indexes in the IMesh are the indexes you get by | ||||
| * a scheme that offsets each MVert, MEdge, and MPoly index by the sum of the | * a scheme that offsets each MVert, MEdge, and MPoly index by the sum of the | ||||
| * vertices, edges, and polys in the preceding Meshes in the mesh span. | * vertices, edges, and polys in the preceding Meshes in the mesh span. | ||||
| * The `*r_info class` is filled in with information needed to make the | * The `*r_info class` is filled in with information needed to make the | ||||
| * correspondence between the Mesh MVerts/MPolys and the IMesh Verts/Faces. | * correspondence between the Mesh MVerts/MPolys and the IMesh Verts/Faces. | ||||
| ▲ Show 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | for (int source_layer_i = 0; source_layer_i < source_cd->totlayer; ++source_layer_i) { | ||||
| orig_mp->totloop, | orig_mp->totloop, | ||||
| dst_block_ofs, | dst_block_ofs, | ||||
| target_layer_i); | target_layer_i); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** Make sure that there are custom data layers in the target mesh | /** | ||||
| * Make sure that there are custom data layers in the target mesh | |||||
| * corresponding to all target layers in all of the operands after the first. | * corresponding to all target layers in all of the operands after the first. | ||||
| * (The target should already have layers for those in the first operand mesh). | * (The target should already have layers for those in the first operand mesh). | ||||
| * Edges done separately -- will have to be done later, after edges are made. | * Edges done separately -- will have to be done later, after edges are made. | ||||
| */ | */ | ||||
| static void merge_vertex_loop_poly_customdata_layers(Mesh *target, MeshesToIMeshInfo &mim) | static void merge_vertex_loop_poly_customdata_layers(Mesh *target, MeshesToIMeshInfo &mim) | ||||
| { | { | ||||
| for (int mesh_index = 1; mesh_index < mim.meshes.size(); ++mesh_index) { | for (int mesh_index = 1; mesh_index < mim.meshes.size(); ++mesh_index) { | ||||
| const Mesh *me = mim.meshes[mesh_index]; | const Mesh *me = mim.meshes[mesh_index]; | ||||
| Show All 18 Lines | for (int mesh_index = 1; mesh_index < mim.meshes.size(); ++mesh_index) { | ||||
| const Mesh *me = mim.meshes[mesh_index]; | const Mesh *me = mim.meshes[mesh_index]; | ||||
| if (me->totedge) { | if (me->totedge) { | ||||
| CustomData_merge( | CustomData_merge( | ||||
| &me->edata, &target->edata, CD_MASK_MESH.emask, CD_DEFAULT, target->totedge); | &me->edata, &target->edata, CD_MASK_MESH.emask, CD_DEFAULT, target->totedge); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** Convert the output IMesh im to a Blender Mesh, | /** | ||||
| * Convert the output IMesh im to a Blender Mesh, | |||||
| * using the information in mim to get all the attributes right. | * using the information in mim to get all the attributes right. | ||||
| */ | */ | ||||
| static Mesh *imesh_to_mesh(IMesh *im, MeshesToIMeshInfo &mim) | static Mesh *imesh_to_mesh(IMesh *im, MeshesToIMeshInfo &mim) | ||||
| { | { | ||||
| constexpr int dbg_level = 0; | constexpr int dbg_level = 0; | ||||
| im->populate_vert(); | im->populate_vert(); | ||||
| int out_totvert = im->vert_size(); | int out_totvert = im->vert_size(); | ||||
| ▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines | |||||