Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_tools.c
| Context not available. | |||||
| static int edbm_solidify_exec(bContext *C, wmOperator *op) | static int edbm_solidify_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Object *obedit = CTX_data_edit_object(C); | |||||
| Mesh *me = obedit->data; | |||||
| BMEditMesh *em = me->edit_btmesh; | |||||
| BMesh *bm = em->bm; | |||||
| BMOperator bmop; | |||||
| const float thickness = RNA_float_get(op->ptr, "thickness"); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| uint objects_len = 0; | |||||
| Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); | |||||
| if (!EDBM_op_init(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) { | for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | ||||
| return OPERATOR_CANCELLED; | Object *obedit = objects[ob_index]; | ||||
| } | BMEditMesh *em = BKE_editmesh_from_object(obedit); | ||||
| /* deselect only the faces in the region to be solidified (leave wire | BMesh *bm = em->bm; | ||||
| * edges and loose verts selected, as there will be no corresponding | BMOperator bmop; | ||||
| * geometry selected below) */ | |||||
| BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "geom", BM_FACE, BM_ELEM_SELECT, true); | |||||
| /* run the solidify operator */ | const float thickness = RNA_float_get(op->ptr, "thickness"); | ||||
| BMO_op_exec(bm, &bmop); | |||||
| /* select the newly generated faces */ | if (!EDBM_op_init(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) { | ||||
| BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "geom.out", BM_FACE, BM_ELEM_SELECT, true); | return OPERATOR_CANCELLED; | ||||
| } | |||||
| if (!EDBM_op_finish(em, &bmop, op, true)) { | /* deselect only the faces in the region to be solidified (leave wire | ||||
| return OPERATOR_CANCELLED; | * edges and loose verts selected, as there will be no corresponding | ||||
| } | * geometry selected below) */ | ||||
| BMO_slot_buffer_hflag_disable(bm, bmop.slots_in, "geom", BM_FACE, BM_ELEM_SELECT, true); | |||||
| EDBM_update_generic(em, true, true); | /* run the solidify operator */ | ||||
| BMO_op_exec(bm, &bmop); | |||||
| return OPERATOR_FINISHED; | /* select the newly generated faces */ | ||||
| BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "geom.out", BM_FACE, BM_ELEM_SELECT, true); | |||||
| if (!EDBM_op_finish(em, &bmop, op, true)) { | |||||
| continue; | |||||
| } | |||||
| EDBM_update_generic(em, true, false); | |||||
| } | |||||
| MEM_freeN(objects); | |||||
| return OPERATOR_FINISHED; | |||||
| } | } | ||||
| void MESH_OT_solidify(wmOperatorType *ot) | void MESH_OT_solidify(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| Context not available. | |||||