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:
authorAntonio Vazquez <blendergit@gmail.com>2020-04-11 20:02:58 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-04-11 20:04:05 +0300
commitddfec0851484fa735b60279743c892bf1952c538 (patch)
treef5ea398a80ac88e1fb3afa6b0b0418837018ba33
parent85de07e64c967e7d80e57d3df2db08fdec16794a (diff)
GPencil: Fix unreported missing update after removing stroke from python
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 94814003e99..4a20df048bd 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -716,10 +716,13 @@ static bGPDstroke *rna_GPencil_stroke_new(bGPDframe *frame)
return stroke;
}
-static void rna_GPencil_stroke_remove(bGPDframe *frame,
+static void rna_GPencil_stroke_remove(ID *id,
+ bGPDframe *frame,
ReportList *reports,
PointerRNA *stroke_ptr)
{
+ bGPdata *gpd = (bGPdata *)id;
+
bGPDstroke *stroke = stroke_ptr->data;
if (BLI_findindex(&frame->strokes, stroke) == -1) {
BKE_report(reports, RPT_ERROR, "Stroke not found in grease pencil frame");
@@ -729,7 +732,8 @@ static void rna_GPencil_stroke_remove(bGPDframe *frame,
BLI_freelinkN(&frame->strokes, stroke);
RNA_POINTER_INVALIDATE(stroke_ptr);
- WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
+ DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);
+ WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
}
static void rna_GPencil_stroke_close(ID *id,
@@ -1282,7 +1286,7 @@ static void rna_def_gpencil_strokes_api(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "remove", "rna_GPencil_stroke_remove");
RNA_def_function_ui_description(func, "Remove a grease pencil stroke");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);