[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34871] trunk/blender/source/blender/ editors/curve/editcurve.c: - Use the same logic as for BEZIERs when making segment of between
Sergey Sharybin
g.ulairi at gmail.com
Tue Feb 15 17:37:45 CET 2011
Revision: 34871
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34871
Author: nazgul
Date: 2011-02-15 16:37:44 +0000 (Tue, 15 Feb 2011)
Log Message:
-----------
- 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.
Modified Paths:
--------------
trunk/blender/source/blender/editors/curve/editcurve.c
Modified: trunk/blender/source/blender/editors/curve/editcurve.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editcurve.c 2011-02-15 16:09:53 UTC (rev 34870)
+++ trunk/blender/source/blender/editors/curve/editcurve.c 2011-02-15 16:37:44 UTC (rev 34871)
@@ -4113,17 +4113,21 @@
}
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 @@
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);
}
More information about the Bf-blender-cvs
mailing list