From 34d67601b716046cf15f3e808a92bc91d0af804f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 17 May 2019 13:59:59 +0200 Subject: Python: Raise an error even NO_MAIN data is assigned to object The goal is to prevent assignment of temporary or evaluated meshes to objects from the main database. Majority of the change is actually related on passing reports around. On a positive side there are more error prints which can become more visible to scripters. There are still possible further improvements in the related areas. For example, disable user counting for evaluated ID datablocks when assignment happens. But can also happen later on as a separate improvement. Reviewers: brecht, campbellbarton, mont29 Reviewed By: brecht Differential Revision: https://developer.blender.org/D4884 --- source/blender/makesrna/intern/rna_gpencil.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '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 8d3bfdde995..c7071ee5155 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -281,7 +281,9 @@ static void set_parent(bGPDlayer *gpl, Object *par, const int type, const char * } /* set parent object and inverse matrix */ -static void rna_GPencilLayer_parent_set(PointerRNA *ptr, PointerRNA value) +static void rna_GPencilLayer_parent_set(struct ReportList *UNUSED(reports), + PointerRNA *ptr, + PointerRNA value) { bGPDlayer *gpl = (bGPDlayer *)ptr->data; Object *par = (Object *)value.data; @@ -375,7 +377,9 @@ static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, NULL, NULL); } -static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value) +static void rna_GPencil_active_layer_set(struct ReportList *UNUSED(reports), + PointerRNA *ptr, + PointerRNA value) { bGPdata *gpd = ptr->id.data; -- cgit v1.2.3