diff options
Diffstat (limited to 'source/blender/editors/curve/editcurve.c')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 84f8f17d4ee..df9527e6fae 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -160,8 +160,9 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase) pt_index = 0; while (a--) { /* We cannot keep *any* reference to curve obdata, - * it might be replaced and freed while editcurve remain in use (in viewport render case e.g.). - * Note that we could use a pool to avoid lots of malloc's here, but... not really a problem for now. */ + * it might be replaced and freed while editcurve remain in use + * (in viewport render case e.g.). Note that we could use a pool to avoid + * lots of malloc's here, but... not really a problem for now. */ BezTriple *origbezt_cpy = MEM_mallocN(sizeof(*origbezt), __func__); *origbezt_cpy = *origbezt; keyIndex = init_cvKeyIndex(origbezt_cpy, key_index, nu_index, pt_index, vertex_index); @@ -180,8 +181,9 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase) pt_index = 0; while (a--) { /* We cannot keep *any* reference to curve obdata, - * it might be replaced and freed while editcurve remain in use (in viewport render case e.g.). - * Note that we could use a pool to avoid lots of malloc's here, but... not really a problem for now. */ + * it might be replaced and freed while editcurve remain in use + * (in viewport render case e.g.). Note that we could use a pool to avoid + * lots of malloc's here, but... not really a problem for now. */ BPoint *origbp_cpy = MEM_mallocN(sizeof(*origbp_cpy), __func__); *origbp_cpy = *origbp; keyIndex = init_cvKeyIndex(origbp_cpy, key_index, nu_index, pt_index, vertex_index); @@ -1272,8 +1274,9 @@ void ED_curve_editnurb_make(Object *obedit) if (actkey) { editnurb->shapenr = obedit->shapenr; - /* Apply shapekey to new nurbs of editnurb, not those of original curve (and *after* we generated keyIndex), - * else we do not have valid 'original' data to properly restore curve when leaving editmode. */ + /* Apply shapekey to new nurbs of editnurb, not those of original curve + * (and *after* we generated keyIndex), else we do not have valid 'original' data + * to properly restore curve when leaving editmode. */ BKE_keyblock_convert_to_curve(actkey, cu, &editnurb->nurbs); } } @@ -1336,7 +1339,8 @@ static int separate_exec(bContext *C, wmOperator *op) } /* 2. Duplicate the object and data. */ - newbase = ED_object_add_duplicate(bmain, scene, view_layer, oldbase, 0); /* 0 = fully linked. */ + newbase = ED_object_add_duplicate( + bmain, scene, view_layer, oldbase, 0); /* 0 = fully linked. */ DEG_relations_tag_update(bmain); newob = newbase->object; @@ -2225,7 +2229,8 @@ static void adduplicateflagNurb(Object *obedit, View3D *v3d, ListBase *newnurb, newu++; for (c = a / nu->pntsu, bp3 = bp2; c < nu->pntsv; c++, bp3 += nu->pntsu) { if (bp3->f1 & flag) { - bp3->f1 |= SURF_SEEN; /* flag as seen so skipped on future iterations */ + /* flag as seen so skipped on future iterations */ + bp3->f1 |= SURF_SEEN; if (newu == 1) newv++; } else { @@ -2722,7 +2727,8 @@ static void curve_smooth_value(ListBase *editnurb, for (last_sel = 0; last_sel < nu->pntsu; last_sel++) { /* loop over selection segments of a curve, smooth each */ - /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */ + /* Start BezTriple code, + * this is duplicated below for points, make sure these functions stay in sync */ start_sel = -1; for (bezt = &nu->bezt[last_sel], a = last_sel; a < nu->pntsu; a++, bezt++) { if (bezt->f2 & SELECT) { @@ -2792,7 +2798,8 @@ static void curve_smooth_value(ListBase *editnurb, for (last_sel = 0; last_sel < nu->pntsu; last_sel++) { /* loop over selection segments of a curve, smooth each */ - /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */ + /* Start BezTriple code, + * this is duplicated below for points, make sure these functions stay in sync */ start_sel = -1; for (bp = &nu->bp[last_sel], a = last_sel; a < nu->pntsu; a++, bp++) { if (bp->f1 & SELECT) { @@ -5499,7 +5506,8 @@ static bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction) while (a--) { if (bp->f1 & SELECT) { nu->flagu ^= CU_NURB_CYCLIC; - BKE_nurb_knot_calc_u(nu); /* 1==u type is ignored for cyclic curves */ + /* 1==u type is ignored for cyclic curves */ + BKE_nurb_knot_calc_u(nu); changed = true; break; } @@ -5515,12 +5523,14 @@ static bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction) if (bp->f1 & SELECT) { if (direction == 0 && nu->pntsu > 1) { nu->flagu ^= CU_NURB_CYCLIC; - BKE_nurb_knot_calc_u(nu); /* 1==u type is ignored for cyclic curves */ + /* 1==u type is ignored for cyclic curves */ + BKE_nurb_knot_calc_u(nu); changed = true; } if (direction == 1 && nu->pntsv > 1) { nu->flagv ^= CU_NURB_CYCLIC; - BKE_nurb_knot_calc_v(nu); /* 2==v type is ignored for cyclic curves */ + /* 2==v type is ignored for cyclic curves */ + BKE_nurb_knot_calc_v(nu); changed = true; } break; |