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>2019-02-18 18:28:25 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-02-18 18:29:04 +0300
commit582ae0c12292c174e4a57840b5ae0e21f42ecfc5 (patch)
tree62a5fe5a2c4a768c51bd6b5c5bd359adbcb84ea6 /source/blender/editors/curve/editcurve_undo.c
parentd02ad52b2de250fa371f664f1f2d08329e0b5a20 (diff)
Fix crash toggling edit mode of curve with animation
The issue was caused by original f-curves being re-allocated without informing dependency graph about this. Was reported in T61636#622757
Diffstat (limited to 'source/blender/editors/curve/editcurve_undo.c')
-rw-r--r--source/blender/editors/curve/editcurve_undo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/curve/editcurve_undo.c b/source/blender/editors/curve/editcurve_undo.c
index 382c5376b03..30dd7346191 100644
--- a/source/blender/editors/curve/editcurve_undo.c
+++ b/source/blender/editors/curve/editcurve_undo.c
@@ -35,6 +35,7 @@
#include "BKE_curve.h"
#include "BKE_fcurve.h"
#include "BKE_layer.h"
+#include "BKE_main.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
@@ -72,7 +73,7 @@ typedef struct {
size_t undo_size;
} UndoCurve;
-static void undocurve_to_editcurve(UndoCurve *ucu, Curve *cu, short *r_shapenr)
+static void undocurve_to_editcurve(Main *bmain, UndoCurve *ucu, Curve *cu, short *r_shapenr)
{
ListBase *undobase = &ucu->nubase;
ListBase *editbase = BKE_curve_editNurbs_get(cu);
@@ -112,7 +113,7 @@ static void undocurve_to_editcurve(UndoCurve *ucu, Curve *cu, short *r_shapenr)
cu->actnu = ucu->actnu;
cu->flag = ucu->flag;
*r_shapenr = ucu->obedit.shapenr;
- ED_curve_updateAnimPaths(cu);
+ ED_curve_updateAnimPaths(bmain, cu);
}
static void undocurve_from_editcurve(UndoCurve *ucu, Curve *cu, const short shapenr)
@@ -235,7 +236,7 @@ static bool curve_undosys_step_encode(struct bContext *C, struct Main *UNUSED(bm
return true;
}
-static void curve_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, int UNUSED(dir))
+static void curve_undosys_step_decode(struct bContext *C, struct Main *bmain, UndoStep *us_p, int UNUSED(dir))
{
CurveUndoStep *us = (CurveUndoStep *)us_p;
@@ -255,7 +256,7 @@ static void curve_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bm
us_p->name, obedit->id.name);
continue;
}
- undocurve_to_editcurve(&elem->data, obedit->data, &obedit->shapenr);
+ undocurve_to_editcurve(bmain, &elem->data, obedit->data, &obedit->shapenr);
DEG_id_tag_update(&obedit->id, ID_RECALC_GEOMETRY);
}