Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_tools.c
| Show First 20 Lines • Show All 1,303 Lines • ▼ Show 20 Lines | void MESH_OT_vert_connect_nonplanar(wmOperatorType *ot) | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* props */ | /* props */ | ||||
| prop = RNA_def_float_rotation(ot->srna, "angle_limit", 0, NULL, 0.0f, DEG2RADF(180.0f), | prop = RNA_def_float_rotation(ot->srna, "angle_limit", 0, NULL, 0.0f, DEG2RADF(180.0f), | ||||
| "Max Angle", "Angle limit", 0.0f, DEG2RADF(180.0f)); | "Max Angle", "Angle limit", 0.0f, DEG2RADF(180.0f)); | ||||
| RNA_def_property_float_default(prop, DEG2RADF(5.0f)); | RNA_def_property_float_default(prop, DEG2RADF(5.0f)); | ||||
| } | } | ||||
| static int edbm_face_make_planar_exec(bContext *C, wmOperator *op) | |||||
| { | |||||
| Object *obedit = CTX_data_edit_object(C); | |||||
| BMEditMesh *em = BKE_editmesh_from_object(obedit); | |||||
| const int repeat = RNA_int_get(op->ptr, "repeat"); | |||||
| const float fac = RNA_float_get(op->ptr, "factor"); | |||||
| if (!EDBM_op_callf( | |||||
| em, op, "planar_faces faces=%hf iterations=%i factor=%f", | |||||
| BM_ELEM_SELECT, repeat, fac)) | |||||
| { | |||||
| return OPERATOR_CANCELLED; | |||||
| } | |||||
| EDBM_update_generic(em, true, true); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| void MESH_OT_face_make_planar(wmOperatorType *ot) | |||||
| { | |||||
| // PropertyRNA *prop; | |||||
sergey: Get rid of it? | |||||
| /* identifiers */ | |||||
| ot->name = "Make Planar"; | |||||
| ot->idname = "MESH_OT_face_make_planar"; | |||||
| ot->description = "XXX"; | |||||
| /* api callbacks */ | |||||
| ot->exec = edbm_face_make_planar_exec; | |||||
| ot->poll = ED_operator_editmesh; | |||||
| /* flags */ | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | |||||
| /* props */ | |||||
| RNA_def_float(ot->srna, "factor", 0.5f, -10.0f, 10.0f, "Factor", "", 0.0f, 1.0f); | |||||
| RNA_def_int(ot->srna, "repeat", 1, 1, 200, | |||||
| "Number of iterations to smooth the mesh", "", 1, 200); | |||||
| } | |||||
| static int edbm_edge_split_exec(bContext *C, wmOperator *op) | static int edbm_edge_split_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| BMEditMesh *em = BKE_editmesh_from_object(obedit); | BMEditMesh *em = BKE_editmesh_from_object(obedit); | ||||
| if (!EDBM_op_call_and_selectf( | if (!EDBM_op_call_and_selectf( | ||||
| em, op, | em, op, | ||||
| ▲ Show 20 Lines • Show All 4,197 Lines • Show Last 20 Lines | |||||
Get rid of it?