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:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-02-15 19:37:44 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2011-02-15 19:37:44 +0300
commit35c03e85efda280f6ed153c0557b928745b55c85 (patch)
treeb0049ae4e5fe82886c24fb4218501b62f2733298 /source/blender/editors/curve
parentc4ad7b4ebeeecd1569458a0e4b04147a7f2de8b8 (diff)
- Use the same logic as for BEZIERs when making segment of between
first and last NURBS' control points (toggle cyclic flag) - Show U/V selection menu only for surface objects. There's no much logic in asking U/V direction for simple curves. - Set active spline when two segments were joined.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 95d2fa7a59b..1e551b64693 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4113,17 +4113,21 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
freeNurb(nu2); nu2= NULL;
}
+
+ set_actNurb(obedit, nu1); /* for selected */
+ ok= 1;
}
-
- set_actNurb(obedit, NULL); /* for selected */
- ok= 1;
- } else if(nu1 && !nu2 && nu1->type == CU_BEZIER) {
- if(!(nu1->flagu & CU_NURB_CYCLIC)) {
- if(nu1->pntsu>1 && BEZSELECTED_HIDDENHANDLES(cu, nu1->bezt) &&
+ } else if(nu1 && !nu2) {
+ if(!(nu1->flagu & CU_NURB_CYCLIC) && nu1->pntsu>1) {
+ if (nu1->type == CU_BEZIER && BEZSELECTED_HIDDENHANDLES(cu, nu1->bezt) &&
BEZSELECTED_HIDDENHANDLES(cu, nu1->bezt+(nu1->pntsu-1))) {
nu1->flagu|= CU_NURB_CYCLIC;
calchandlesNurb(nu1);
ok= 1;
+ } else if (nu1->type == CU_NURBS && nu1->bp->f1&SELECT && (nu1->bp+(nu1->pntsu-1))->f1&SELECT) {
+ nu1->flagu|= CU_NURB_CYCLIC;
+ nurbs_knot_calc_u(nu1);
+ ok= 1;
}
}
}
@@ -4836,18 +4840,20 @@ static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
uiLayout *layout;
Nurb *nu;
- for(nu= editnurb->first; nu; nu= nu->next) {
- if(nu->pntsu>1 || nu->pntsv>1) {
- if(nu->type==CU_NURBS) {
- pup= uiPupMenuBegin(C, "Direction", ICON_NULL);
- layout= uiPupMenuLayout(pup);
- uiItemsEnumO(layout, op->type->idname, "direction");
- uiPupMenuEnd(C, pup);
- return OPERATOR_CANCELLED;
+ if(obedit->type == OB_SURF) {
+ for(nu= editnurb->first; nu; nu= nu->next) {
+ if(nu->pntsu>1 || nu->pntsv>1) {
+ if(nu->type==CU_NURBS) {
+ pup= uiPupMenuBegin(C, "Direction", ICON_NULL);
+ layout= uiPupMenuLayout(pup);
+ uiItemsEnumO(layout, op->type->idname, "direction");
+ uiPupMenuEnd(C, pup);
+ return OPERATOR_CANCELLED;
+ }
}
}
}
-
+
return toggle_cyclic_exec(C, op);
}