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

This commit is contained in:
Joshua Leung 2014-10-15 12:56:29 +13:00
parent 2f49be5b20
commit f87d38b5f5
Notes: blender-bot 2023-02-14 20:03:06 +01:00
Referenced by issue blender/blender-addons#42225, Python: GreasePencil.active does not accept a GPencilLayer, but GreasePencil type?!
1 changed files with 3 additions and 1 deletions

View File

@ -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");