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:
authorClément Foucault <foucault.clem@gmail.com>2018-09-25 19:50:57 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-09-25 23:51:54 +0300
commit2cff9b4cb605047927fbb1c774fdafcfd2ab534e (patch)
tree101d1efb5507a9dbde2934b04f081e77ed1e131b /source/blender/editors/curve/editcurve_select.c
parent05d0e5315b99f939687838b50519d0702b4c8fb4 (diff)
Curves: Move draw options to overlays
This commit add one regression: it is impossible to currently hide handles in the viewport. But this should be fixed in another commit.
Diffstat (limited to 'source/blender/editors/curve/editcurve_select.c')
-rw-r--r--source/blender/editors/curve/editcurve_select.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c
index 7fcf7e073dc..d7ceb86c373 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -115,14 +115,14 @@ static bool swap_selection_bpoint(BPoint *bp)
return select_bpoint(bp, SELECT, SELECT, VISIBLE);
}
-bool ED_curve_nurb_select_check(Curve *cu, Nurb *nu)
+bool ED_curve_nurb_select_check(View3D *v3d, Nurb *nu)
{
if (nu->type == CU_BEZIER) {
BezTriple *bezt;
int i;
for (i = nu->pntsu, bezt = nu->bezt; i--; bezt++) {
- if (BEZT_ISSEL_ANY_HIDDENHANDLES(cu, bezt)) {
+ if (BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt)) {
return true;
}
}
@@ -140,7 +140,7 @@ bool ED_curve_nurb_select_check(Curve *cu, Nurb *nu)
return false;
}
-int ED_curve_nurb_select_count(Curve *cu, Nurb *nu)
+int ED_curve_nurb_select_count(View3D *v3d, Nurb *nu)
{
int sel = 0;
@@ -149,7 +149,7 @@ int ED_curve_nurb_select_count(Curve *cu, Nurb *nu)
int i;
for (i = nu->pntsu, bezt = nu->bezt; i--; bezt++) {
- if (BEZT_ISSEL_ANY_HIDDENHANDLES(cu, bezt)) {
+ if (BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt)) {
sel++;
}
}
@@ -216,12 +216,12 @@ void ED_curve_nurb_deselect_all(Nurb *nu)
}
}
-bool ED_curve_select_check(Curve *cu, struct EditNurb *editnurb)
+bool ED_curve_select_check(View3D *v3d, struct EditNurb *editnurb)
{
Nurb *nu;
for (nu = editnurb->nurbs.first; nu; nu = nu->next) {
- if (ED_curve_nurb_select_check(cu, nu)) {
+ if (ED_curve_nurb_select_check(v3d, nu)) {
return true;
}
}
@@ -459,6 +459,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
int action = RNA_enum_get(op->ptr, "action");
ViewLayer *view_layer = CTX_data_view_layer(C);
+ View3D *v3d = CTX_wm_view3d(C);
uint objects_len = 0;
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
@@ -468,7 +469,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
Object *obedit = objects[ob_index];
Curve *cu = obedit->data;
- if (ED_curve_select_check(cu, cu->editnurb)) {
+ if (ED_curve_select_check(v3d, cu->editnurb)) {
action = SEL_DESELECT;
break;
}
@@ -487,7 +488,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op)
ED_curve_deselect_all(cu->editnurb);
break;
case SEL_INVERT:
- ED_curve_select_swap(cu->editnurb, (cu->drawflag & CU_HIDE_HANDLES) != 0);
+ ED_curve_select_swap(cu->editnurb, (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0);
break;
}
@@ -525,6 +526,7 @@ void CURVE_OT_select_all(wmOperatorType *ot)
static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
{
ViewLayer *view_layer = CTX_data_view_layer(C);
+ View3D *v3d = CTX_wm_view3d(C);
uint objects_len = 0;
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
@@ -537,7 +539,7 @@ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
bool changed = false;
for (nu = nurbs->first; nu; nu = nu->next) {
- if (ED_curve_nurb_select_check(cu, nu)) {
+ if (ED_curve_nurb_select_check(v3d, nu)) {
ED_curve_nurb_select_all(nu);
changed = true;
}