[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57046] trunk/blender/source/blender/ editors/curve/editcurve.c: Fix #35504: Blender crashes on separating curves with different Evaluation Time / keyframes

Sergey Sharybin sergey.vfx at gmail.com
Mon May 27 12:08:57 CEST 2013


Revision: 57046
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57046
Author:   nazgul
Date:     2013-05-27 10:08:56 +0000 (Mon, 27 May 2013)
Log Message:
-----------
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.

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	2013-05-27 08:04:07 UTC (rev 57045)
+++ trunk/blender/source/blender/editors/curve/editcurve.c	2013-05-27 10:08:56 UTC (rev 57046)
@@ -1177,7 +1177,11 @@
 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;
 
 	if (adt->action)
@@ -1416,12 +1420,14 @@
 	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);
 		}




More information about the Bf-blender-cvs mailing list