Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curve/editcurve_select.c
| Show First 20 Lines • Show All 758 Lines • ▼ Show 20 Lines | void CURVE_OT_select_previous(wmOperatorType *ot) | ||||
| ot->poll = ED_operator_editcurve; | ot->poll = ED_operator_editcurve; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| /***************** select more operator **********************/ | /***************** select more operator **********************/ | ||||
| static int select_more_exec(bContext *C, wmOperator *UNUSED(op)) | static void select_more(Object *obedit) { | ||||
| { | |||||
| Object *obedit = CTX_data_edit_object(C); | |||||
| ListBase *editnurb = object_editcurve_get(obedit); | ListBase *editnurb = object_editcurve_get(obedit); | ||||
| Nurb *nu; | Nurb *nu; | ||||
| BPoint *bp, *tempbp; | BPoint *bp, *tempbp; | ||||
| int a; | int a; | ||||
| short sel = 0; | short sel = 0; | ||||
| /* note that NURBS surface is a special case because we mimic */ | /* note that NURBS surface is a special case because we mimic */ | ||||
| /* the behavior of "select more" of mesh tools. */ | /* the behavior of "select more" of mesh tools. */ | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | for (nu = editnurb->first; nu; nu = nu->next) { | ||||
| MEM_freeN(selbpoints); | MEM_freeN(selbpoints); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| select_adjacent_cp(editnurb, 1, 0, SELECT); | select_adjacent_cp(editnurb, 1, 0, SELECT); | ||||
| select_adjacent_cp(editnurb, -1, 0, SELECT); | select_adjacent_cp(editnurb, -1, 0, SELECT); | ||||
| } | } | ||||
| } | |||||
| static int select_more_exec(bContext *C, wmOperator *UNUSED(op)) | |||||
| { | |||||
| 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); | |||||
| for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | |||||
| Object *obedit = objects[ob_index]; | |||||
| select_more(obedit); | |||||
| DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE); | DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE); | ||||
| WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); | WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); | ||||
| } | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void CURVE_OT_select_more(wmOperatorType *ot) | void CURVE_OT_select_more(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Select More"; | ot->name = "Select More"; | ||||
| ▲ Show 20 Lines • Show All 953 Lines • Show Last 20 Lines | |||||