[Bf-blender-cvs] [bfde694] blender-v2.72-release: Bugfix T42225: Python - GreasePencil.active incorrectly accepts GreasePencil type instead of GPencilLayer

Joshua Leung noreply at git.blender.org
Wed Oct 15 16:59:00 CEST 2014


Commit: bfde694bd0a1ee557cb470af89fb866d90d1e29f
Author: Joshua Leung
Date:   Wed Oct 15 12:56:29 2014 +1300
Branches: blender-v2.72-release
https://developer.blender.org/rBbfde694bd0a1ee557cb470af89fb866d90d1e29f

Bugfix T42225: Python - GreasePencil.active incorrectly accepts GreasePencil type instead of GPencilLayer

===================================================================

M	source/blender/makesrna/intern/rna_gpencil.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index cdedb35..c467771 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");




More information about the Bf-blender-cvs mailing list