[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33222] trunk/blender/source/blender/ editors/curve/editcurve.c: Toggle cyclic on when creating segment between first and last points of non-cyclic bezier
Sergey Sharybin
g.ulairi at gmail.com
Sun Nov 21 20:29:11 CET 2010
Revision: 33222
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33222
Author: nazgul
Date: 2010-11-21 20:29:08 +0100 (Sun, 21 Nov 2010)
Log Message:
-----------
Toggle cyclic on when creating segment between first and last points of non-cyclic bezier
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 2010-11-21 19:01:18 UTC (rev 33221)
+++ trunk/blender/source/blender/editors/curve/editcurve.c 2010-11-21 19:29:08 UTC (rev 33222)
@@ -3712,7 +3712,7 @@
BezTriple *bezt;
BPoint *bp;
float *fp, offset;
- int a;
+ int a, ok= 0;
/* first decide if this is a surface merge! */
if(obedit->type==OB_SURF) nu= nubase->first;
@@ -3854,16 +3854,27 @@
}
set_actNurb(obedit, NULL); /* for selected */
+ ok= 1;
+ } else if(nu1 && !nu2 && nu1->type == CU_BEZIER) {
+ if(!(nu1->flagu & CU_NURB_CYCLIC)) {
+ if(BEZSELECTED_HIDDENHANDLES(cu, nu1->bezt) &&
+ BEZSELECTED_HIDDENHANDLES(cu, bezt+(nu1->pntsu-1))) {
+ nu1->flagu|= CU_NURB_CYCLIC;
+ calchandlesNurb(nu1);
+ ok= 1;
+ }
+ }
+ }
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
- DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
-
- return OPERATOR_FINISHED;
- }
- else {
+ if(!ok) {
BKE_report(op->reports, RPT_ERROR, "Can't make segment");
return OPERATOR_CANCELLED;
}
+
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+
+ return OPERATOR_FINISHED;
}
void CURVE_OT_make_segment(wmOperatorType *ot)
More information about the Bf-blender-cvs
mailing list