Fix T62460: undo doesn't work in files that have a paint curve.

This commit is contained in:
Brecht Van Lommel 2019-03-14 18:58:37 +01:00
parent f3a3d74bcf
commit 9d4fd25735
Notes: blender-bot 2023-02-14 03:23:50 +01:00
Referenced by issue #62460, Undo doesn't work in this file in particular
1 changed files with 6 additions and 0 deletions

View File

@ -84,6 +84,9 @@ typedef struct PaintCurveUndoStep {
static bool paintcurve_undosys_poll(bContext *C)
{
if (C == NULL || !paint_curve_poll(C)) {
return false;
}
Paint *p = BKE_paint_get_active_from_context(C);
return (p->brush && p->brush->paint_curve);
}
@ -96,6 +99,9 @@ static void paintcurve_undosys_step_encode_init(struct bContext *C, UndoStep *us
static bool paintcurve_undosys_step_encode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p)
{
if (C == NULL || !paint_curve_poll(C)) {
return false;
}
Paint *p = BKE_paint_get_active_from_context(C);
PaintCurve *pc = p ? (p->brush ? p->brush->paint_curve : NULL) : NULL;
if (pc == NULL) {