From 4c712fd17eade91d1eac65edae09f39460ae60ea Mon Sep 17 00:00:00 2001 From: Antonioya Date: Tue, 7 Aug 2018 14:15:41 +0200 Subject: [PATCH] Fix T56263: Crash when sculpting a GP object with animation This is a limitation of the current operator design. I have added a test to be sure the operator is not initializated while play animations to avoid segment fault. In the future, we can enable this option again, but it will need a operator redesign. --- source/blender/editors/gpencil/gpencil_brush.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 0fadef55b9d..aed55c15b19 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1814,9 +1814,18 @@ static int gpsculpt_brush_invoke(bContext *C, wmOperator *op, const wmEvent *eve { tGP_BrushEditData *gso = NULL; const bool is_modal = RNA_boolean_get(op->ptr, "wait_for_input"); + const bool is_playing = ED_screen_animation_playing(CTX_wm_manager(C)) != NULL ? true : false; bool needs_timer = false; float brush_rate = 0.0f; + /* the operator cannot work while play animation */ + if (is_playing) { + BKE_report(op->reports, RPT_ERROR, + "Cannot sculpt while play animation"); + + return OPERATOR_CANCELLED; + } + /* init painting data */ if (!gpsculpt_brush_init(C, op)) return OPERATOR_CANCELLED;