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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-14 20:58:37 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-14 20:59:11 +0300
commit9d4fd2573531ea841ed0940b3babbe76da2e6d02 (patch)
tree73ae575318db49527853ea04116ade7f03544d8e /source/blender/editors/sculpt_paint/paint_curve_undo.c
parentf3a3d74bcfb0d7a5af1320b9398cddcb4d0d9f9b (diff)
Fix T62460: undo doesn't work in files that have a paint curve.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_curve_undo.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_curve_undo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_curve_undo.c b/source/blender/editors/sculpt_paint/paint_curve_undo.c
index fb2f4b49f19..1eaed8eabb8 100644
--- a/source/blender/editors/sculpt_paint/paint_curve_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_curve_undo.c
@@ -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) {