From 343e8512127561bf61343802024c157e08d0907e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 27 May 2013 10:08:56 +0000 Subject: Fix #35504: Blender crashes on separating curves with different Evaluation Time / keyframes Used slightly different approach from what was discussed with Campbell, and the reason of this is slightly better support of curve point animation re-mapping. There're actually some limitations which better be discussed bewfore 'b': - If there're no point animation, spline separation goes just fine. - If there're animated points in the curve, blender will preserve animation for currently editing curve. But, since new curve created by Separate operator shares the same AnimData, it'll be animatied in a weird way. So not sure whether it's better to preserve animation for current spline but require switching animationdata for new spline or resetting animation for current curve's animation data. --- source/blender/editors/curve/editcurve.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors/curve/editcurve.c') diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 60e107b9c15..0383c0d1d1a 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1177,6 +1177,10 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves) int ED_curve_updateAnimPaths(Curve *cu) { AnimData *adt = BKE_animdata_from_id(&cu->id); + EditNurb *editnurb = cu->editnurb; + + if (!editnurb->keyindex) + return 0; if (!curve_is_animated(cu)) return 0; @@ -1416,12 +1420,14 @@ static int separate_exec(bContext *C, wmOperator *op) newedit = newcu->editnurb; BKE_nurbList_free(&newedit->nurbs); BKE_curve_editNurb_keyIndex_free(newedit); + newedit->keyindex = NULL; /* 3. move over parts from old object */ for (nu = oldedit->nurbs.first; nu; nu = nu1) { nu1 = nu->next; if (isNurbsel(nu)) { + keyIndex_delNurb(oldedit, nu); BLI_remlink(&oldedit->nurbs, nu); BLI_addtail(&newedit->nurbs, nu); } -- cgit v1.2.3