curve select toggle was broken from recent select operator update
authorCampbell Barton <ideasman42@gmail.com>
Mon, 30 Nov 2009 12:50:22 +0000 (12:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 30 Nov 2009 12:50:22 +0000 (12:50 +0000)
source/blender/editors/curve/editcurve.c
source/blender/editors/include/ED_curve.h

index a65e1164a27ca71731197561bb781c3762ed6782..a139a75f844ab094116d6d53cf915d5fd376ea51 100644 (file)
@@ -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 *********************/
index 3166f77815cb9300f0fc15dfa11e5a4d5abd9524..0cfa743b0fac240730230308900f76c63c60ef69 100644 (file)
@@ -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);