Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curve/editcurve.c
| Show First 20 Lines • Show All 992 Lines • ▼ Show 20 Lines | |||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| ListBase *editnurb = object_editcurve_get(obedit); | ListBase *editnurb = object_editcurve_get(obedit); | ||||
| bool changed = false; | bool changed = false; | ||||
| bool changed_size = false; | bool changed_size = false; | ||||
| const bool use_handles = RNA_boolean_get(op->ptr, "use_handles"); | const bool use_handles = RNA_boolean_get(op->ptr, "use_handles"); | ||||
| const int type = RNA_enum_get(op->ptr, "type"); | const int type = RNA_enum_get(op->ptr, "type"); | ||||
| if (ELEM(type, CU_CARDINAL, CU_BSPLINE)) { | |||||
| BKE_report(op->reports, RPT_ERROR, "Not yet implemented"); | |||||
| continue; | |||||
| } | |||||
| LISTBASE_FOREACH (Nurb *, nu, editnurb) { | LISTBASE_FOREACH (Nurb *, nu, editnurb) { | ||||
| if (ED_curve_nurb_select_check(v3d, nu)) { | if (ED_curve_nurb_select_check(v3d, nu)) { | ||||
| const int pntsu_prev = nu->pntsu; | const int pntsu_prev = nu->pntsu; | ||||
| const char *err_msg = NULL; | const char *err_msg = NULL; | ||||
| if (BKE_nurb_type_convert(nu, type, use_handles, &err_msg)) { | if (BKE_nurb_type_convert(nu, type, use_handles, &err_msg)) { | ||||
| changed = true; | changed = true; | ||||
| if (pntsu_prev != nu->pntsu) { | if (pntsu_prev != nu->pntsu) { | ||||
| changed_size = true; | changed_size = true; | ||||
| Show All 27 Lines | |||||
| return ret_value; | return ret_value; | ||||
| } | } | ||||
| void CURVE_OT_spline_type_set(wmOperatorType *ot) | void CURVE_OT_spline_type_set(wmOperatorType *ot) | ||||
| { | { | ||||
| static const EnumPropertyItem type_items[] = { | static const EnumPropertyItem type_items[] = { | ||||
| {CU_POLY, "POLY", 0, "Poly", ""}, | {CU_POLY, "POLY", 0, "Poly", ""}, | ||||
| {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, | {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, | ||||
| // {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, | |||||
| // {CU_BSPLINE, "B_SPLINE", 0, "B-Spline", ""}, | |||||
| {CU_NURBS, "NURBS", 0, "NURBS", ""}, | {CU_NURBS, "NURBS", 0, "NURBS", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Set Spline Type"; | ot->name = "Set Spline Type"; | ||||
| ot->description = "Set type of active spline"; | ot->description = "Set type of active spline"; | ||||
| ot->idname = "CURVE_OT_spline_type_set"; | ot->idname = "CURVE_OT_spline_type_set"; | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||