Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curve/editcurve.c
| Context not available. | |||||
| static int curve_delete_exec(bContext *C, wmOperator *op) | static int curve_delete_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Object *obedit = CTX_data_edit_object(C); | |||||
| Curve *cu = (Curve *)obedit->data; | |||||
| eCurveElem_Types type = RNA_enum_get(op->ptr, "type"); | eCurveElem_Types type = RNA_enum_get(op->ptr, "type"); | ||||
| int retval = OPERATOR_CANCELLED; | int retval = OPERATOR_CANCELLED; | ||||
| if (type == CURVE_VERTEX) retval = curve_delete_vertices(obedit); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| else if (type == CURVE_SEGMENT) retval = curve_delete_segments(obedit, false); | uint objects_len = 0; | ||||
| else BLI_assert(0); | Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); | ||||
| for (uint ob_index = 0; ob_index < objects_len; ob_index++) | |||||
| { | |||||
| Object *obedit = objects[ob_index]; | |||||
| Curve *cu = (Curve *)obedit->data; | |||||
| if (retval == OPERATOR_FINISHED) { | if (type == CURVE_VERTEX) retval = curve_delete_vertices(obedit); | ||||
| cu->actnu = cu->actvert = CU_ACT_NONE; | else if (type == CURVE_SEGMENT) retval = curve_delete_segments(obedit, false); | ||||
| else BLI_assert(0); | |||||
| if (ED_curve_updateAnimPaths(obedit->data)) WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, obedit); | if (retval == OPERATOR_FINISHED) { | ||||
| cu->actnu = cu->actvert = CU_ACT_NONE; | |||||
| WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data); | if (ED_curve_updateAnimPaths(obedit->data)) WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, obedit); | ||||
| DEG_id_tag_update(obedit->data, 0); | |||||
| return retval; | WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data); | ||||
| DEG_id_tag_update(obedit->data, 0); | |||||
| } | |||||
| } | } | ||||
| MEM_freeN(objects); | |||||
| return retval; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static const EnumPropertyItem curve_delete_type_items[] = { | static const EnumPropertyItem curve_delete_type_items[] = { | ||||
| Context not available. | |||||