Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2010-12-06 20:49:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2010-12-06 20:49:57 +0300
commit59268ca715bf605554002952173bc5e691c0ea04 (patch)
treeae9e386fc09e8f388561fb08b2f3ce898999f9de /source/blender/editors/curve
parent2c7a2a6a419f5d73baa958238f64a91d51ee7fae (diff)
Update curve animation data when loading UndoCurve -- fixes memory corruption
when starting playback after undo-ing topology changes The simpliest way was to change data at which undoCurve_to_editCurve and editCurve_to_undoCurve works from curve to object. Maybe it's not very cool, but still better than moving curve animation handlers outside of editcurve module.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 86cc4f2dd9d..07a588ad0da 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -6695,9 +6695,10 @@ static void *undo_check_lastsel(void *lastsel, Nurb *nu, Nurb *newnu)
return NULL;
}
-static void undoCurve_to_editCurve(void *ucu, void *cue)
+static void undoCurve_to_editCurve(void *ucu, void *obe)
{
- Curve *cu= cue;
+ Object *obedit= obe;
+ Curve *cu= (Curve*)obedit->data;
UndoCurve *undoCurve= ucu;
ListBase *undobase= &undoCurve->nubase;
ListBase *editbase= ED_curve_editnurbs(cu);
@@ -6728,11 +6729,14 @@ static void undoCurve_to_editCurve(void *ucu, void *cue)
}
cu->lastsel= lastsel;
+
+ ED_curve_updateAnimPaths(obedit);
}
-static void *editCurve_to_undoCurve(void *cue)
+static void *editCurve_to_undoCurve(void *obe)
{
- Curve *cu= cue;
+ Object *obedit= obe;
+ Curve *cu= (Curve*)obedit->data;
ListBase *nubase= ED_curve_editnurbs(cu);
UndoCurve *undoCurve;
EditNurb *editnurb= cu->editnurb, tmpEditnurb;
@@ -6782,7 +6786,7 @@ static void free_undoCurve(void *ucv)
static void *get_data(bContext *C)
{
Object *obedit= CTX_data_edit_object(C);
- return obedit->data;
+ return obedit;
}
/* and this is all the undo system needs to know */