From bfde694bd0a1ee557cb470af89fb866d90d1e29f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 15 Oct 2014 12:56:29 +1300 Subject: Bugfix T42225: Python - GreasePencil.active incorrectly accepts GreasePencil type instead of GPencilLayer --- source/blender/makesrna/intern/rna_gpencil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index cdedb3576b0..c4677710676 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -101,6 +101,8 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value) gl->flag &= ~GP_LAYER_ACTIVE; } } + + WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); } } @@ -586,7 +588,7 @@ static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "GreasePencil"); + RNA_def_property_struct_type(prop, "GPencilLayer"); RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer"); -- cgit v1.2.3