diff options
author | Bastien Montagne <bastien@blender.org> | 2021-01-06 17:50:12 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-01-06 17:59:23 +0300 |
commit | a584aef4703aeefe0843f3b8aa2c1e863f825aef (patch) | |
tree | 818860977367409c3381021915345044dfacb5cb /source/blender/editors/sculpt_paint | |
parent | 691c021679f6a2038536fcec0bdd7de654c79853 (diff) |
Undo: Further tweak/fixes the 'use context' flag of undo types.
Note that this is fairly fragile still, especially in cases like paint
cureve undo, which actually does not use context in most cases (and can
be called with a NULL context), but do need it in one case. This will
need a proper rework at some point.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_curve_undo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_curve_undo.c b/source/blender/editors/sculpt_paint/paint_curve_undo.c index 82ed4917004..c78af7c38c6 100644 --- a/source/blender/editors/sculpt_paint/paint_curve_undo.c +++ b/source/blender/editors/sculpt_paint/paint_curve_undo.c @@ -102,9 +102,12 @@ static bool paintcurve_undosys_step_encode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p) { - if (C == NULL || !paint_curve_poll(C)) { + /* FIXME Double check this, it should not be needed here at all? undo system is supposed to + * ensure that. */ + if (!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) { |