Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-11-30 15:50:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-30 15:50:22 +0300
commit0f24af750680f7467433f1522d69a4fcc835fc93 (patch)
tree21b060e8017c2c26ed7978666205d10510effc2b /source/blender/editors
parenta2140192fe0784538c9b9e905d0672b05ec00b5d (diff)
curve select toggle was broken from recent select operator update
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/curve/editcurve.c80
-rw-r--r--source/blender/editors/include/ED_curve.h1
2 files changed, 46 insertions, 35 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index a65e1164a27..a139a75f844 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -381,8 +381,46 @@ void CU_select_all(Object *obedit)
ListBase *editnurb= curve_get_editcurve(obedit);
if (editnurb) {
- selectend_nurb(obedit, FIRST, 0, DESELECT); /* set first control points as unselected */
- select_adjacent_cp(editnurb, 1, 1, DESELECT); /* cascade selection */
+ selectend_nurb(obedit, FIRST, 0, SELECT); /* set first control points as unselected */
+ select_adjacent_cp(editnurb, 1, 1, SELECT); /* cascade selection */
+ }
+}
+
+void CU_select_swap(Object *obedit)
+{
+ ListBase *editnurb= curve_get_editcurve(obedit);
+
+ if (editnurb) {
+ Curve *cu= obedit->data;
+ Nurb *nu;
+ BPoint *bp;
+ BezTriple *bezt;
+ int a;
+
+ for(nu= editnurb->first; nu; nu= nu->next) {
+ if(nu->type == CU_BEZIER) {
+ bezt= nu->bezt;
+ a= nu->pntsu;
+ while(a--) {
+ if(bezt->hide==0) {
+ bezt->f2 ^= SELECT; /* always do the center point */
+ if((cu->drawflag & CU_HIDE_HANDLES)==0) {
+ bezt->f1 ^= SELECT;
+ bezt->f3 ^= SELECT;
+ }
+ }
+ bezt++;
+ }
+ }
+ else {
+ bp= nu->bp;
+ a= nu->pntsu*nu->pntsv;
+ while(a--) {
+ swap_selection_bpoint(bp);
+ bp++;
+ }
+ }
+ }
}
}
@@ -1604,7 +1642,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit);
int action = RNA_enum_get(op->ptr, "action");
-
+
if (action == SEL_TOGGLE) {
action = SEL_SELECT;
if(nurb_has_selected_cps(editnurb))
@@ -1619,39 +1657,8 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
CU_deselect_all(obedit);
break;
case SEL_INVERT:
- {
- Curve *cu= obedit->data;
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
-
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->hide==0) {
- bezt->f2 ^= SELECT; /* always do the center point */
- if((cu->drawflag & CU_HIDE_HANDLES)==0) {
- bezt->f1 ^= SELECT;
- bezt->f3 ^= SELECT;
- }
- }
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- swap_selection_bpoint(bp);
- bp++;
- }
- }
- }
+ CU_select_swap(obedit);
break;
- }
}
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
@@ -1671,6 +1678,9 @@ void CURVE_OT_select_all(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ WM_operator_properties_select_all(ot);
}
/********************** hide operator *********************/
diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h
index 3166f77815c..0cfa743b0fa 100644
--- a/source/blender/editors/include/ED_curve.h
+++ b/source/blender/editors/include/ED_curve.h
@@ -45,6 +45,7 @@ void ED_keymap_curve (struct wmKeyConfig *keyconf);
/* editcurve.c */
void CU_deselect_all(struct Object *obedit);
void CU_select_all(struct Object *obedit);
+void CU_select_swap(struct Object *obedit);
void undo_push_curve (struct bContext *C, char *name);