Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_mask_extract.c
| Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | static int geometry_extract_apply(bContext *C, | ||||
| Object *new_ob = ED_object_add_type(C, OB_MESH, NULL, ob->loc, ob->rot, false, local_view_bits); | Object *new_ob = ED_object_add_type(C, OB_MESH, NULL, ob->loc, ob->rot, false, local_view_bits); | ||||
| BKE_mesh_nomain_to_mesh(new_mesh, new_ob->data, new_ob, &CD_MASK_EVERYTHING, true); | BKE_mesh_nomain_to_mesh(new_mesh, new_ob->data, new_ob, &CD_MASK_EVERYTHING, true); | ||||
| /* Remove the Face Sets as they need to be recreated when entering Sculpt Mode in the new object. | /* Remove the Face Sets as they need to be recreated when entering Sculpt Mode in the new object. | ||||
| * TODO(pablodobarro): In the future we can try to preserve them from the original mesh. */ | * TODO(pablodobarro): In the future we can try to preserve them from the original mesh. */ | ||||
| Mesh *new_ob_mesh = new_ob->data; | Mesh *new_ob_mesh = new_ob->data; | ||||
| CustomData_free_layers(&new_ob_mesh->pdata, CD_SCULPT_FACE_SETS, new_ob_mesh->totpoly); | CustomData_free_layers(&new_ob_mesh->pdata, CD_SCULPT_FACE_SETS, new_ob_mesh->totpoly); | ||||
| /* Remove the mask from the new object so it can be sculpted directly after extracting. */ | |||||
| CustomData_free_layers(&new_ob_mesh->vdata, CD_PAINT_MASK, new_ob_mesh->totvert); | |||||
| if (params->apply_shrinkwrap) { | if (params->apply_shrinkwrap) { | ||||
| BKE_shrinkwrap_mesh_nearest_surface_deform(C, new_ob, ob); | BKE_shrinkwrap_mesh_nearest_surface_deform(C, new_ob, ob); | ||||
| } | } | ||||
| if (params->add_solidify) { | if (params->add_solidify) { | ||||
| ED_object_modifier_add( | ED_object_modifier_add( | ||||
| op->reports, bmain, scene, new_ob, "geometry_extract_solidify", eModifierType_Solidify); | op->reports, bmain, scene, new_ob, "geometry_extract_solidify", eModifierType_Solidify); | ||||
| SolidifyModifierData *sfmd = (SolidifyModifierData *)BKE_modifiers_findby_name( | SolidifyModifierData *sfmd = (SolidifyModifierData *)BKE_modifiers_findby_name( | ||||
| ▲ Show 20 Lines • Show All 387 Lines • Show Last 20 Lines | |||||