Python: Raise an error even NO_MAIN data is assigned to object
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 17 May 2019 11:59:59 +0000 (13:59 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 17 May 2019 12:27:13 +0000 (14:27 +0200)
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

50 files changed:
source/blender/blenkernel/intern/library.c
source/blender/editors/curve/editfont.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_eyedropper_datablock.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/io/io_cache.c
source/blender/editors/render/render_shading.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_data.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_node/node_add.c
source/blender/editors/space_text/text_ops.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_gpencil.c
source/blender/makesrna/intern/rna_gpencil_modifier.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_layer.c
source/blender/makesrna/intern/rna_linestyle.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_mask.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_mesh_utils.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_palette.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_shader_fx.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/makesrna/intern/rna_wm.c
source/blender/python/intern/bpy_rna.c

index 3e6f93d1323ad99d821755d02299e5bb522c49c5..7fb6f78def1df1533fd9a9fcd5da110452298a4b 100644 (file)
@@ -873,7 +873,7 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
 
         /* assign copy */
         RNA_id_pointer_create(newid, &idptr);
-        RNA_property_pointer_set(ptr, prop, idptr);
+        RNA_property_pointer_set(NULL, ptr, prop, idptr);
         RNA_property_update(C, ptr, prop);
 
         /* tag grease pencil datablock and disable onion */
index d1b1f43d8dd63787d0fbc05134a69967d07422a6..0759b64d14a7451b89972df23a785c5a89e3159a 100644 (file)
@@ -2007,7 +2007,7 @@ static int font_open_exec(bContext *C, wmOperator *op)
     id_us_min(&font->id);
 
     RNA_id_pointer_create(&font->id, &idptr);
-    RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
+    RNA_property_pointer_set(NULL, &pprop->ptr, pprop->prop, idptr);
     RNA_property_update(C, &pprop->ptr, pprop->prop);
   }
 
@@ -2090,7 +2090,7 @@ static int font_unlink_exec(bContext *C, wmOperator *op)
   builtin_font = BKE_vfont_builtin_get();
 
   RNA_id_pointer_create(&builtin_font->id, &idptr);
-  RNA_property_pointer_set(&pprop.ptr, pprop.prop, idptr);
+  RNA_property_pointer_set(NULL, &pprop.ptr, pprop.prop, idptr);
   RNA_property_update(C, &pprop.ptr, pprop.prop);
 
   return OPERATOR_FINISHED;
index 0e4b07f4b489adb0f32aa85a127a3a9784031f5e..f1724d9240265006fc9b211a1d672cecf2fffe32 100644 (file)
@@ -2772,7 +2772,7 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
       }
       else if (type == PROP_POINTER) {
         if (str[0] == '\0') {
-          RNA_property_pointer_set(&but->rnapoin, but->rnaprop, PointerRNA_NULL);
+          RNA_property_pointer_set(NULL, &but->rnapoin, but->rnaprop, PointerRNA_NULL);
           return true;
         }
         else {
@@ -2788,14 +2788,14 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
            * Fact remains, using editstr as main 'reference' over whole search button thingy
            * is utterly weak and should be redesigned imho, but that's not a simple task. */
           if (prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr)) {
-            RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr);
+            RNA_property_pointer_set(NULL, &but->rnapoin, but->rnaprop, rptr);
           }
           else if (but->func_arg2 != NULL) {
             RNA_pointer_create(NULL,
                                RNA_property_pointer_type(&but->rnapoin, but->rnaprop),
                                but->func_arg2,
                                &rptr);
-            RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr);
+            RNA_property_pointer_set(NULL, &but->rnapoin, but->rnaprop, rptr);
           }
 
           return true;
index 1d90139eade071d73f7609ea8ec36d758ab12235..4a2d59c05ded3da2db88e8907e4834b7cd60e45e 100644 (file)
@@ -207,7 +207,7 @@ static bool datadropper_id_set(bContext *C, DataDropper *ddr, ID *id)
 
   RNA_id_pointer_create(id, &ptr_value);
 
-  RNA_property_pointer_set(&ddr->ptr, ddr->prop, ptr_value);
+  RNA_property_pointer_set(NULL, &ddr->ptr, ddr->prop, ptr_value);
 
   RNA_property_update(C, &ddr->ptr, ddr->prop);
 
index e4adf757c800aef9fd3a07709e357e3085a7975e..a3b438ece42bd8ad4fb4c69d68abcedb78c42137 100644 (file)
@@ -1744,7 +1744,7 @@ static void ui_selectcontext_apply(bContext *C,
       }
       else if (rna_type == PROP_POINTER) {
         const PointerRNA other_value = delta.p;
-        RNA_property_pointer_set(&lptr, lprop, other_value);
+        RNA_property_pointer_set(NULL, &lptr, lprop, other_value);
       }
 
       RNA_property_update(C, &lptr, prop);
index 9e91505f5e8661d5872a078cb8641c21a92248fa..3dbfd3d2f6a92bfc29c10a8b111d0bc2172c647a 100644 (file)
@@ -298,7 +298,7 @@ static void template_ID_set_property_cb(bContext *C, void *arg_template, void *i
     PointerRNA idptr;
 
     RNA_id_pointer_create(item, &idptr);
-    RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr);
+    RNA_property_pointer_set(NULL, &template_ui->ptr, template_ui->prop, idptr);
     RNA_property_update(C, &template_ui->ptr, template_ui->prop);
   }
 }
@@ -489,7 +489,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
       break;
     case UI_ID_DELETE:
       memset(&idptr, 0, sizeof(idptr));
-      RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr);
+      RNA_property_pointer_set(NULL, &template_ui->ptr, template_ui->prop, idptr);
       RNA_property_update(C, &template_ui->ptr, template_ui->prop);
 
       if (id && CTX_wm_window(C)->eventstate->shift) {
@@ -532,7 +532,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
             idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
           }
         }
-        RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr);
+        RNA_property_pointer_set(NULL, &template_ui->ptr, template_ui->prop, idptr);
         RNA_property_update(C, &template_ui->ptr, template_ui->prop);
       }
       break;
@@ -541,7 +541,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
         BKE_override_static_free(&id->override_static);
         /* reassign to get get proper updates/notifiers */
         idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
-        RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr);
+        RNA_property_pointer_set(NULL, &template_ui->ptr, template_ui->prop, idptr);
         RNA_property_update(C, &template_ui->ptr, template_ui->prop);
       }
       break;
@@ -1455,7 +1455,7 @@ static void template_search_handle_cb(bContext *C, void *arg_template, void *ite
   PointerRNA item_ptr;
 
   RNA_pointer_create(NULL, type, item, &item_ptr);
-  RNA_property_pointer_set(&coll_search->target_ptr, coll_search->target_prop, item_ptr);
+  RNA_property_pointer_set(NULL, &coll_search->target_ptr, coll_search->target_prop, item_ptr);
   RNA_property_update(C, &coll_search->target_ptr, coll_search->target_prop);
 }
 
index 3dd3b20bda3eda99a841e9fbb4efc0f1e19bfe4f..e2b3b6aa8c64011156e26fb6e8cfcb80e5092b62 100644 (file)
@@ -108,7 +108,7 @@ static int cachefile_open_exec(bContext *C, wmOperator *op)
 
       PointerRNA idptr;
       RNA_id_pointer_create(&cache_file->id, &idptr);
-      RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
+      RNA_property_pointer_set(NULL, &pprop->ptr, pprop->prop, idptr);
       RNA_property_update(C, &pprop->ptr, pprop->prop);
     }
 
index 3186f011c6ab2f4f584f2d34000aa2c9a517c4a5..8819b7a541d2d8f0136e2ebc1beff654644c35d3 100644 (file)
@@ -595,7 +595,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
     id_us_min(&ma->id);
 
     RNA_id_pointer_create(&ma->id, &idptr);
-    RNA_property_pointer_set(&ptr, prop, idptr);
+    RNA_property_pointer_set(NULL, &ptr, prop, idptr);
     RNA_property_update(C, &ptr, prop);
   }
 
@@ -644,7 +644,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
     id_us_min(&tex->id);
 
     RNA_id_pointer_create(&tex->id, &idptr);
-    RNA_property_pointer_set(&ptr, prop, idptr);
+    RNA_property_pointer_set(NULL, &ptr, prop, idptr);
     RNA_property_update(C, &ptr, prop);
   }
 
@@ -695,7 +695,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
     id_us_min(&wo->id);
 
     RNA_id_pointer_create(&wo->id, &idptr);
-    RNA_property_pointer_set(&ptr, prop, idptr);
+    RNA_property_pointer_set(NULL, &ptr, prop, idptr);
     RNA_property_update(C, &ptr, prop);
   }
 
index 25c05e2d1d0f157ddaebb3a56b80d646f16f4869..692681cecb70cc661e49c35dd1a80c07c401caa3 100644 (file)
@@ -136,7 +136,7 @@ static int sound_open_exec(bContext *C, wmOperator *op)
     id_us_min(&sound->id);
 
     RNA_id_pointer_create(&sound->id, &idptr);
-    RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
+    RNA_property_pointer_set(NULL, &pprop->ptr, pprop->prop, idptr);
     RNA_property_update(C, &pprop->ptr, pprop->prop);
   }
 
index db504272d2f67993a30515fa3547e80156af556a..d3e5c011579004a85db272f7c1f9788313e89ad1 100644 (file)
@@ -155,7 +155,7 @@ static void actedit_change_action(bContext *C, bAction *act)
   RNA_id_pointer_create((ID *)act, &idptr);
 
   /* set the new pointer, and force a refresh */
-  RNA_property_pointer_set(&ptr, prop, idptr);
+  RNA_property_pointer_set(NULL, &ptr, prop, idptr);
   RNA_property_update(C, &ptr, prop);
 }
 
@@ -261,7 +261,7 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op))
      * NOTE: we can't use actedit_change_action, as this function is also called from the NLA
      */
     RNA_id_pointer_create(&action->id, &idptr);
-    RNA_property_pointer_set(&ptr, prop, idptr);
+    RNA_property_pointer_set(NULL, &ptr, prop, idptr);
     RNA_property_update(C, &ptr, prop);
   }
 
@@ -619,7 +619,7 @@ void ED_animedit_unlink_action(
       prop = RNA_struct_find_property(&ptr, "action");
 
       /* clear... */
-      RNA_property_pointer_set(&ptr, prop, PointerRNA_NULL);
+      RNA_property_pointer_set(NULL, &ptr, prop, PointerRNA_NULL);
       RNA_property_update(C, &ptr, prop);
     }
   }
index a6b1db1aa8344ea644ffcd7ea8680f66781e772c..e5698ede59af0f9a176f144c3e55a168449b62c6 100644 (file)
@@ -245,7 +245,7 @@ static int open_exec(bContext *C, wmOperator *op)
     id_us_min(&clip->id);
 
     RNA_id_pointer_create(&clip->id, &idptr);
-    RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
+    RNA_property_pointer_set(NULL, &pprop->ptr, pprop->prop, idptr);
     RNA_property_update(C, &pprop->ptr, pprop->prop);
   }
   else if (sc) {
index a25ba6fbd9b021a400229c57b2833e5533abc9da..b49fd92beb321678eda60aa143cea11c9247285e 100644 (file)
@@ -1339,7 +1339,7 @@ static int image_open_exec(bContext *C, wmOperator *op)
 
     PointerRNA imaptr;
     RNA_id_pointer_create(&ima->id, &imaptr);
-    RNA_property_pointer_set(&iod->pprop.ptr, iod->pprop.prop, imaptr);
+    RNA_property_pointer_set(NULL, &iod->pprop.ptr, iod->pprop.prop, imaptr);
     RNA_property_update(C, &iod->pprop.ptr, iod->pprop.prop);
   }
 
@@ -2426,7 +2426,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
 
     PointerRNA imaptr;
     RNA_id_pointer_create(&ima->id, &imaptr);
-    RNA_property_pointer_set(&data->pprop.ptr, data->pprop.prop, imaptr);
+    RNA_property_pointer_set(NULL, &data->pprop.ptr, data->pprop.prop, imaptr);
     RNA_property_update(C, &data->pprop.ptr, data->pprop.prop);
   }
   else if (sima) {
index 714ed707e18da129b3c87403e7a9c2b02b31e220..e677c649fb47ca440aedd9c963508f99e026012b 100644 (file)
@@ -521,7 +521,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
     id_us_min(&ntree->id);
 
     RNA_id_pointer_create(&ntree->id, &idptr);
-    RNA_property_pointer_set(&ptr, prop, idptr);
+    RNA_property_pointer_set(NULL, &ptr, prop, idptr);
     RNA_property_update(C, &ptr, prop);
   }
   else if (snode) {
index a3a438c322027202afa4ad46d7682fe9e69f94c5..a9dd2a59d1ebebd93893fa4aee2ad30a348932d0 100644 (file)
@@ -247,7 +247,7 @@ static int text_new_exec(bContext *C, wmOperator *UNUSED(op))
 
   if (prop) {
     RNA_id_pointer_create(&text->id, &idptr);
-    RNA_property_pointer_set(&ptr, prop, idptr);
+    RNA_property_pointer_set(NULL, &ptr, prop, idptr);
     RNA_property_update(C, &ptr, prop);
   }
   else if (st) {
@@ -326,7 +326,7 @@ static int text_open_exec(bContext *C, wmOperator *op)
 
   if (pprop->prop) {
     RNA_id_pointer_create(&text->id, &idptr);
-    RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
+    RNA_property_pointer_set(NULL, &pprop->ptr, pprop->prop, idptr);
     RNA_property_update(C, &pprop->ptr, pprop->prop);
   }
   else if (st) {
index a7b111d49da90a618934a49b4602567a56f49fc0..5aee34df6f74f835bdcaf67d17e41b2e1eef6782 100644 (file)
@@ -1031,7 +1031,10 @@ int RNA_property_enum_step(
     const struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, int from_value, int step);
 
 PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop);
-void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value);
+void RNA_property_pointer_set(struct ReportList *reports,
+                              PointerRNA *ptr,
+                              PropertyRNA *prop,
+                              PointerRNA ptr_value);
 PointerRNA RNA_property_pointer_get_default(PointerRNA *ptr, PropertyRNA *prop);
 
 void RNA_property_collection_begin(PointerRNA *ptr,
index 83c115aa7515905961e143665f1707e139191904..a77402cb88dcb9497c1e473300cc87ba1150d38b 100644 (file)
@@ -1033,10 +1033,10 @@ static char *rna_def_property_set_func(
       break;
     }
     case PROP_POINTER: {
-      fprintf(f, "void %s(PointerRNA *ptr, PointerRNA value)\n", func);
+      fprintf(f, "void %s(struct ReportList *reports, PointerRNA *ptr, PointerRNA value)\n", func);
       fprintf(f, "{\n");
       if (manualfunc) {
-        fprintf(f, "    %s(ptr, value);\n", manualfunc);
+        fprintf(f, "    %s(reports, ptr, value);\n", manualfunc);
       }
       else {
         rna_print_data_get(f, dp);
index a12951d9796a6b27dcc4813a97a7c544f99a6ae7..b56a031f9df30b7f5e3ea46d19b7f2a58d068e26 100644 (file)
@@ -3733,24 +3733,29 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
   }
 }
 
-void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value)
+void RNA_property_pointer_set(ReportList *reports,
+                              PointerRNA *ptr,
+                              PropertyRNA *prop,
+                              PointerRNA ptr_value)
 {
   PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
   BLI_assert(RNA_property_type(prop) == PROP_POINTER);
 
   /* Check types */
   if (ptr_value.type != NULL && !RNA_struct_is_a(ptr_value.type, pprop->type)) {
-    printf("%s: expected %s type, not %s.\n",
-           __func__,
-           pprop->type->identifier,
-           ptr_value.type->identifier);
+    BKE_reportf(reports,
+                RPT_ERROR,
+                "%s: expected %s type, not %s.\n",
+                __func__,
+                pprop->type->identifier,
+                ptr_value.type->identifier);
     return;
   }
 
   /* RNA */
   if (pprop->set && !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) &&
       !((prop->flag & PROP_ID_SELF_CHECK) && ptr->id.data == ptr_value.id.data)) {
-    pprop->set(ptr, ptr_value);
+    pprop->set(reports, ptr, ptr_value);
   }
   /* IDProperty */
   else if (prop->flag & PROP_EDITABLE) {
@@ -6422,7 +6427,7 @@ void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
   PropertyRNA *prop = RNA_struct_find_property(ptr, name);
 
   if (prop) {
-    RNA_property_pointer_set(ptr, prop, ptr_value);
+    RNA_property_pointer_set(NULL, ptr, prop, ptr_value);
   }
   else {
     printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
@@ -7971,7 +7976,7 @@ bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
 
     case PROP_POINTER: {
       PointerRNA value = RNA_property_pointer_get_default(ptr, prop);
-      RNA_property_pointer_set(ptr, prop, value);
+      RNA_property_pointer_set(NULL, ptr, prop, value);
       return true;
     }
 
index bb3585df24edd6852b0120f6fe5648e6695a2e67..e99a1ffe2bee8492b7832c6d7fcc8030ccfc1940 100644 (file)
@@ -214,7 +214,9 @@ static PointerRNA rna_Action_active_pose_marker_get(PointerRNA *ptr)
       ptr, &RNA_TimelineMarker, BLI_findlink(&act->markers, act->active_marker - 1));
 }
 
-static void rna_Action_active_pose_marker_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Action_active_pose_marker_set(struct ReportList *UNUSED(reports),
+                                              PointerRNA *ptr,
+                                              PointerRNA value)
 {
   bAction *act = (bAction *)ptr->data;
   act->active_marker = BLI_findindex(&act->markers, value.data) + 1;
index 6a5bae28cc1de759dd5de0d1f141e108645f28d1..ba7929521f977eea20d2f54ffe0fc80575484068 100644 (file)
@@ -151,7 +151,9 @@ static int rna_AnimData_action_editable(PointerRNA *ptr, const char **UNUSED(r_i
     return PROP_EDITABLE;
 }
 
-static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value)
+static void rna_AnimData_action_set(struct ReportList *UNUSED(reports),
+                                    PointerRNA *ptr,
+                                    PointerRNA value)
 {
   ID *ownerId = (ID *)ptr->id.data;
 
@@ -461,7 +463,9 @@ static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr)
       ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path - 1));
 }
 
-static void rna_KeyingSet_active_ksPath_set(PointerRNA *ptr, PointerRNA value)
+static void rna_KeyingSet_active_ksPath_set(struct ReportList *UNUSED(reports),
+                                            PointerRNA *ptr,
+                                            PointerRNA value)
 {
   KeyingSet *ks = (KeyingSet *)ptr->data;
   KS_Path *ksp = (KS_Path *)value.data;
@@ -612,7 +616,9 @@ static PointerRNA rna_NlaTrack_active_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_NlaTrack, track);
 }
 
-static void rna_NlaTrack_active_set(PointerRNA *ptr, PointerRNA value)
+static void rna_NlaTrack_active_set(struct ReportList *UNUSED(reports),
+                                    PointerRNA *ptr,
+                                    PointerRNA value)
 {
   AnimData *adt = (AnimData *)ptr->data;
   NlaTrack *track = (NlaTrack *)value.data;
index 0eec5973ab064fb886f017e215c1e2b2120f4bf4..3aef22f5f7f0ff78b14e54208fbf02b466c6c0d6 100644 (file)
@@ -67,7 +67,9 @@ static void rna_Armature_dependency_update(Main *bmain, Scene *UNUSED(scene), Po
   WM_main_add_notifier(NC_GEOM | ND_DATA, id);
 }
 
-static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Armature_act_bone_set(struct ReportList *UNUSED(reports),
+                                      PointerRNA *ptr,
+                                      PointerRNA value)
 {
   bArmature *arm = (bArmature *)ptr->data;
 
@@ -89,7 +91,9 @@ static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value)
   }
 }
 
-static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Armature_act_edit_bone_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   bArmature *arm = (bArmature *)ptr->data;
 
@@ -395,7 +399,9 @@ static PointerRNA rna_EditBone_parent_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->parent);
 }
 
-static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
+static void rna_EditBone_parent_set(struct ReportList *UNUSED(reports),
+                                    PointerRNA *ptr,
+                                    PointerRNA value)
 {
   EditBone *ebone = (EditBone *)(ptr->data);
   EditBone *pbone, *parbone = (EditBone *)value.data;
@@ -463,7 +469,9 @@ static PointerRNA rna_EditBone_bbone_prev_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->bbone_prev);
 }
 
-static void rna_EditBone_bbone_prev_set(PointerRNA *ptr, PointerRNA value)
+static void rna_EditBone_bbone_prev_set(struct ReportList *UNUSED(reports),
+                                        PointerRNA *ptr,
+                                        PointerRNA value)
 {
   EditBone *ebone = (EditBone *)(ptr->data);
   EditBone *hbone = (EditBone *)value.data;
@@ -474,7 +482,9 @@ static void rna_EditBone_bbone_prev_set(PointerRNA *ptr, PointerRNA value)
   }
 }
 
-static void rna_Bone_bbone_prev_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Bone_bbone_prev_set(struct ReportList *UNUSED(reports),
+                                    PointerRNA *ptr,
+                                    PointerRNA value)
 {
   Bone *bone = (Bone *)ptr->data;
   Bone *hbone = (Bone *)value.data;
@@ -491,7 +501,9 @@ static PointerRNA rna_EditBone_bbone_next_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->bbone_next);
 }
 
-static void rna_EditBone_bbone_next_set(PointerRNA *ptr, PointerRNA value)
+static void rna_EditBone_bbone_next_set(struct ReportList *UNUSED(reports),
+                                        PointerRNA *ptr,
+                                        PointerRNA value)
 {
   EditBone *ebone = (EditBone *)(ptr->data);
   EditBone *hbone = (EditBone *)value.data;
@@ -502,7 +514,9 @@ static void rna_EditBone_bbone_next_set(PointerRNA *ptr, PointerRNA value)
   }
 }
 
-static void rna_Bone_bbone_next_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Bone_bbone_next_set(struct ReportList *UNUSED(reports),
+                                    PointerRNA *ptr,
+                                    PointerRNA value)
 {
   Bone *bone = (Bone *)ptr->data;
   Bone *hbone = (Bone *)value.data;
index 160634307f9b37d62a019a7c5d3323fa25ff0f7d..bab7075b75b318160f95741ea5fd0f2f371ca7b6 100644 (file)
@@ -306,7 +306,9 @@ static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr)
   return rna_object_shapekey_index_get(ob->data, sim->shapekey_rest);
 }
 
-static void rna_ClothSettings_rest_shape_key_set(PointerRNA *ptr, PointerRNA value)
+static void rna_ClothSettings_rest_shape_key_set(struct ReportList *UNUSED(reports),
+                                                 PointerRNA *ptr,
+                                                 PointerRNA value)
 {
   Object *ob = (Object *)ptr->id.data;
   ClothSimSettings *sim = (ClothSimSettings *)ptr->data;
index 41ad94f61194139ac5714f9059156137399dd5b9..252dc40f3f5da5ea3a248264639c0e8c7a0e9525 100644 (file)
@@ -351,7 +351,9 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
   }
 }
 
-static void rna_ConstraintTargetBone_target_set(PointerRNA *ptr, PointerRNA value)
+static void rna_ConstraintTargetBone_target_set(struct ReportList *UNUSED(reports),
+                                                PointerRNA *ptr,
+                                                PointerRNA value)
 {
   bConstraintTarget *tgt = (bConstraintTarget *)ptr->data;
   Object *ob = value.data;
@@ -665,7 +667,9 @@ static bool rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value)
   return 0;
 }
 
-static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Constraint_followTrack_camera_set(struct ReportList *UNUSED(reports),
+                                                  PointerRNA *ptr,
+                                                  PointerRNA value)
 {
   bConstraint *con = (bConstraint *)ptr->data;
   bFollowTrackConstraint *data = (bFollowTrackConstraint *)con->data;
@@ -682,7 +686,9 @@ static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr, PointerRNA va
   }
 }
 
-static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Constraint_followTrack_depthObject_set(struct ReportList *UNUSED(reports),
+                                                       PointerRNA *ptr,
+                                                       PointerRNA value)
 {
   bConstraint *con = (bConstraint *)ptr->data;
   bFollowTrackConstraint *data = (bFollowTrackConstraint *)con->data;
@@ -712,7 +718,9 @@ static bool rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, Pointer
   return 0;
 }
 
-static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Constraint_objectSolver_camera_set(struct ReportList *UNUSED(reports),
+                                                   PointerRNA *ptr,
+                                                   PointerRNA value)
 {
   bConstraint *con = (bConstraint *)ptr->data;
   bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data;
index 9c7ad60f3783d741c2842b0e90ec8d76fdf103d6..111e8956414dcd74e8ada1ccd6f6abf39e0a51a6 100644 (file)
@@ -438,7 +438,9 @@ static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, NULL, NULL);
 }
 
-static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Curve_bevelObject_set(struct ReportList *UNUSED(reports),
+                                      PointerRNA *ptr,
+                                      PointerRNA value)
 {
   Curve *cu = (Curve *)ptr->id.data;
   Object *ob = (Object *)value.data;
@@ -481,7 +483,9 @@ static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, NULL, NULL);
 }
 
-static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Curve_taperObject_set(struct ReportList *UNUSED(reports),
+                                      PointerRNA *ptr,
+                                      PointerRNA value)
 {
   Curve *cu = (Curve *)ptr->id.data;
   Object *ob = (Object *)value.data;
@@ -730,7 +734,9 @@ static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, NULL, NULL);
 }
 
-static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Curve_active_spline_set(struct ReportList *UNUSED(reports),
+                                        PointerRNA *ptr,
+                                        PointerRNA value)
 {
   Curve *cu = (Curve *)ptr->data;
   Nurb *nu = value.data;
index 2574fb14b56fb995ef8593910392dcca7cf7409d..1edcbf0774de9c6002beb3b695b6dda27624de70 100644 (file)
@@ -239,7 +239,9 @@ static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA *
 /* ----------- */
 
 /* note: this function exists only to avoid id refcounting */
-static void rna_DriverTarget_id_set(PointerRNA *ptr, PointerRNA value)
+static void rna_DriverTarget_id_set(struct ReportList *UNUSED(reports),
+                                    PointerRNA *ptr,
+                                    PointerRNA value)
 {
   DriverTarget *dtar = (DriverTarget *)ptr->data;
   dtar->id = value.data;
@@ -446,7 +448,9 @@ static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
     fcu->rna_path = NULL;
 }
 
-static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
+static void rna_FCurve_group_set(struct ReportList *UNUSED(reports),
+                                 PointerRNA *ptr,
+                                 PointerRNA value)
 {
   ID *pid = (ID *)ptr->id.data;
   ID *vid = (ID *)value.id.data;
@@ -566,7 +570,9 @@ static PointerRNA rna_FCurve_active_modifier_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_FModifier, fcm);
 }
 
-static void rna_FCurve_active_modifier_set(PointerRNA *ptr, PointerRNA value)
+static void rna_FCurve_active_modifier_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   FCurve *fcu = (FCurve *)ptr->data;
   set_active_fmodifier(&fcu->modifiers, (FModifier *)value.data);
index 8d3bfdde9956b741373adeb5ab1c4ef5b5eeea6c..c7071ee51553a4c06db7565069dc02da7ee7744b 100644 (file)
@@ -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;
 
index d1ae46a74f7b6d6d9e160dd4b7bfe15b66c0ae51..afefa66e2ae962713b5655aa1256f0ad5eff4445 100644 (file)
@@ -296,7 +296,8 @@ static void greasepencil_modifier_object_set(Object *self,
 }
 
 #  define RNA_GP_MOD_OBJECT_SET(_type, _prop, _obtype) \
-    static void rna_##_type##GpencilModifier_##_prop##_set(PointerRNA *ptr, PointerRNA value) \
+    static void rna_##_type##GpencilModifier_##_prop##_set( \
+        struct ReportList *UNUSED(reports), PointerRNA *ptr, PointerRNA value) \
     { \
       _type##GpencilModifierData *tmd = (_type##GpencilModifierData *)ptr->data; \
       greasepencil_modifier_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \
@@ -308,7 +309,9 @@ RNA_GP_MOD_OBJECT_SET(Mirror, object, OB_EMPTY);
 
 #  undef RNA_GP_MOD_OBJECT_SET
 
-static void rna_HookGpencilModifier_object_set(PointerRNA *ptr, PointerRNA value)
+static void rna_HookGpencilModifier_object_set(struct ReportList *UNUSED(reports),
+                                               PointerRNA *ptr,
+                                               PointerRNA value)
 {
   HookGpencilModifierData *hmd = ptr->data;
   Object *ob = (Object *)value.data;
index 83ec33286f4b0832b2b309c3ef782a4fd712e80c..40c8c7e1582b9a9c16673e5b08b787aeaa010af9 100644 (file)
@@ -479,7 +479,9 @@ static PointerRNA rna_render_slots_active_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_RenderSlot, render_slot);
 }
 
-static void rna_render_slots_active_set(PointerRNA *ptr, PointerRNA value)
+static void rna_render_slots_active_set(struct ReportList *UNUSED(reports),
+                                        PointerRNA *ptr,
+                                        PointerRNA value)
 {
   Image *image = (Image *)ptr->id.data;
   if (value.id.data == image) {
index 938db92755c347a01b864ca902af70fa0bbdd850..0f71eec524068d2c1b272b057787cd5f33ea16ba 100644 (file)
@@ -277,7 +277,9 @@ int rna_object_shapekey_index_set(struct ID *id, PointerRNA value, int current);
 /* ViewLayer related functions defined in rna_scene.c but required in rna_layer.c */
 void rna_def_freestyle_settings(struct BlenderRNA *brna);
 struct PointerRNA rna_FreestyleLineSet_linestyle_get(struct PointerRNA *ptr);
-void rna_FreestyleLineSet_linestyle_set(struct PointerRNA *ptr, struct PointerRNA value);
+void rna_FreestyleLineSet_linestyle_set(struct ReportList *reports,
+                                        struct PointerRNA *ptr,
+                                        struct PointerRNA value);
 struct FreestyleLineSet *rna_FreestyleSettings_lineset_add(struct ID *id,
                                                            struct FreestyleSettings *config,
                                                            struct Main *bmain,
index 92c895bd854a64856056150a6d3b62665a4a8608..14d850be012d1ee6ad448df27fd3288828a78fb2 100644 (file)
@@ -37,6 +37,7 @@ struct IDProperty;
 struct Main;
 struct PointerRNA;
 struct PropertyRNA;
+struct ReportList;
 struct Scene;
 struct StructRNA;
 struct bContext;
@@ -85,7 +86,9 @@ typedef const EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C,
                                                     bool *r_free);
 typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr);
 typedef StructRNA *(*PropPointerTypeFunc)(struct PointerRNA *ptr);
-typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value);
+typedef void (*PropPointerSetFunc)(struct ReportList *reports,
+                                   struct PointerRNA *ptr,
+                                   const PointerRNA value);
 typedef bool (*PropPointerPollFunc)(struct PointerRNA *ptr, const PointerRNA value);
 typedef bool (*PropPointerPollFuncPy)(struct PointerRNA *ptr,
                                       const PointerRNA value,
index 1985099e0601a53a956ccc8d955e894dc65cde45..65233d5ccc1574fa427764f61a160d19b6daff63 100644 (file)
@@ -316,7 +316,9 @@ static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr)
   return rna_object_shapekey_index_get(ptr->id.data, kb->relative);
 }
 
-static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value)
+static void rna_ShapeKey_relative_key_set(struct ReportList *UNUSED(reports),
+                                          PointerRNA *ptr,
+                                          PointerRNA value)
 {
   KeyBlock *kb = (KeyBlock *)ptr->data;
 
index c8af49c47ffc1df18f605881c2a0ca6d736f3d62..0f8a2ee56ac5e5c63f52440857cd17fe18d18b45 100644 (file)
@@ -67,7 +67,9 @@ static PointerRNA rna_ViewLayer_active_layer_collection_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_LayerCollection, lc);
 }
 
-static void rna_ViewLayer_active_layer_collection_set(PointerRNA *ptr, PointerRNA value)
+static void rna_ViewLayer_active_layer_collection_set(struct ReportList *UNUSED(reports),
+                                                      PointerRNA *ptr,
+                                                      PointerRNA value)
 {
   ViewLayer *view_layer = (ViewLayer *)ptr->data;
   LayerCollection *lc = (LayerCollection *)value.data;
@@ -84,7 +86,9 @@ static PointerRNA rna_LayerObjects_active_object_get(PointerRNA *ptr)
       ptr, &RNA_Object, view_layer->basact ? view_layer->basact->object : NULL);
 }
 
-static void rna_LayerObjects_active_object_set(PointerRNA *ptr, PointerRNA value)
+static void rna_LayerObjects_active_object_set(struct ReportList *UNUSED(reports),
+                                               PointerRNA *ptr,
+                                               PointerRNA value)
 {
   ViewLayer *view_layer = (ViewLayer *)ptr->data;
   if (value.data)
index 3a6f283e1dcde25911088a2210b2b2c0d8f3bd84..b98b21a7722d3f43415c5c3abfd2ab79db51b1a6 100644 (file)
@@ -356,7 +356,9 @@ static PointerRNA rna_LineStyle_active_texture_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
 }
 
-static void rna_LineStyle_active_texture_set(PointerRNA *ptr, PointerRNA value)
+static void rna_LineStyle_active_texture_set(struct ReportList *UNUSED(reports),
+                                             PointerRNA *ptr,
+                                             PointerRNA value)
 {
   FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data;
 
index abcaccd7b6ba4ef142ce03be34885e440d5f9770..bd06cfc193646fdb61cf43ea8a1fb89517866e18 100644 (file)
@@ -208,6 +208,13 @@ static void rna_Main_scenes_remove(
 
 static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
 {
+  if (data != NULL && (data->tag & LIB_TAG_NO_MAIN)) {
+    BKE_report(reports,
+               RPT_ERROR,
+               "Can not create object in main database with an evaluated data data-block");
+    return NULL;
+  }
+
   char safe_name[MAX_ID_NAME - 2];
   rna_idname_validate(name, safe_name);
 
index 8b27c69604e81944b5e4d5e415b492a1b4e37dc8..563372dd4cfa828a148992791d770d0eb017d122 100644 (file)
@@ -116,7 +116,9 @@ static void rna_Mask_update_parent(Main *bmain, Scene *scene, PointerRNA *ptr)
 }
 
 /* note: this function exists only to avoid id refcounting */
-static void rna_MaskParent_id_set(PointerRNA *ptr, PointerRNA value)
+static void rna_MaskParent_id_set(struct ReportList *UNUSED(reports),
+                                  PointerRNA *ptr,
+                                  PointerRNA value)
 {
   MaskParent *mpar = (MaskParent *)ptr->data;
 
@@ -191,7 +193,9 @@ static PointerRNA rna_Mask_layer_active_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_MaskLayer, masklay);
 }
 
-static void rna_Mask_layer_active_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Mask_layer_active_set(struct ReportList *UNUSED(reports),
+                                      PointerRNA *ptr,
+                                      PointerRNA value)
 {
   Mask *mask = (Mask *)ptr->id.data;
   MaskLayer *masklay = (MaskLayer *)value.data;
@@ -226,7 +230,9 @@ static PointerRNA rna_MaskLayer_active_spline_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_MaskSpline, masklay->act_spline);
 }
 
-static void rna_MaskLayer_active_spline_set(PointerRNA *ptr, PointerRNA value)
+static void rna_MaskLayer_active_spline_set(struct ReportList *UNUSED(reports),
+                                            PointerRNA *ptr,
+                                            PointerRNA value)
 {
   MaskLayer *masklay = (MaskLayer *)ptr->data;
   MaskSpline *spline = (MaskSpline *)value.data;
@@ -245,7 +251,9 @@ static PointerRNA rna_MaskLayer_active_spline_point_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_MaskSplinePoint, masklay->act_point);
 }
 
-static void rna_MaskLayer_active_spline_point_set(PointerRNA *ptr, PointerRNA value)
+static void rna_MaskLayer_active_spline_point_set(struct ReportList *UNUSED(reports),
+                                                  PointerRNA *ptr,
+                                                  PointerRNA value)
 {
   MaskLayer *masklay = (MaskLayer *)ptr->data;
   MaskSpline *spline;
index edfdbe293a3693ab5126363948c4c2dfddec6669..93dc7febd323f10297e55d1f6e376dcf8f91832f 100644 (file)
@@ -330,7 +330,9 @@ static int rna_GpencilColorData_is_fill_visible_get(PointerRNA *ptr)
   return ((pcolor->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (pcolor->fill_style > 0));
 }
 
-static void rna_GpencilColorData_stroke_image_set(PointerRNA *ptr, PointerRNA value)
+static void rna_GpencilColorData_stroke_image_set(struct ReportList *UNUSED(reports),
+                                                  PointerRNA *ptr,
+                                                  PointerRNA value)
 {
   MaterialGPencilStyle *pcolor = ptr->data;
   ID *id = value.data;
@@ -339,7 +341,9 @@ static void rna_GpencilColorData_stroke_image_set(PointerRNA *ptr, PointerRNA va
   pcolor->sima = (struct Image *)id;
 }
 
-static void rna_GpencilColorData_fill_image_set(PointerRNA *ptr, PointerRNA value)
+static void rna_GpencilColorData_fill_image_set(struct ReportList *UNUSED(reports),
+                                                PointerRNA *ptr,
+                                                PointerRNA value)
 {
   MaterialGPencilStyle *pcolor = (MaterialGPencilStyle *)ptr->data;
   ID *id = value.data;
index ff1484087281e7f9554825612abefc68da325ade..2da35b55bd51e65e2917832620cb2d23e5b1861e 100644 (file)
@@ -83,7 +83,8 @@
     return rna_pointer_inherit_refine(ptr, &RNA_##layer_rna_type, layer); \
   } \
 \
-  static void rna_Mesh_##collection_name##_##active_type##_set(PointerRNA *ptr, PointerRNA value) \
+  static void rna_Mesh_##collection_name##_##active_type##_set( \
+      struct ReportList *UNUSED(reports), PointerRNA *ptr, PointerRNA value) \
   { \
     Mesh *me = rna_mesh(ptr); \
     CustomData *data = rna_mesh_##customdata_type(ptr); \
index a3abf0237c8d2e1d75dc6c65803a18eaeffb6677..28d02c6de00f9232fd6d1d7263df48edce659d53 100644 (file)
@@ -719,7 +719,8 @@ static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRN
 }
 
 #  define RNA_MOD_OBJECT_SET(_type, _prop, _obtype) \
-    static void rna_##_type##Modifier_##_prop##_set(PointerRNA *ptr, PointerRNA value) \
+    static void rna_##_type##Modifier_##_prop##_set( \
+        struct ReportList *UNUSED(reports), PointerRNA *ptr, PointerRNA value) \
     { \
       _type##ModifierData *tmd = (_type##ModifierData *)ptr->data; \
       modifier_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \
@@ -741,7 +742,9 @@ RNA_MOD_OBJECT_SET(Shrinkwrap, target, OB_MESH);
 RNA_MOD_OBJECT_SET(Shrinkwrap, auxTarget, OB_MESH);
 RNA_MOD_OBJECT_SET(SurfaceDeform, target, OB_MESH);
 
-static void rna_HookModifier_object_set(PointerRNA *ptr, PointerRNA value)
+static void rna_HookModifier_object_set(struct ReportList *UNUSED(reports),
+                                        PointerRNA *ptr,
+                                        PointerRNA value)
 {
   Object *owner = (Object *)ptr->id.data;
   HookModifierData *hmd = ptr->data;
@@ -824,7 +827,9 @@ static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Object, *ob);
 }
 
-static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value)
+static void rna_UVProjector_object_set(struct ReportList *UNUSED(reports),
+                                       PointerRNA *ptr,
+                                       PointerRNA value)
 {
   Object **ob_p = (Object **)ptr->data;
   Object *ob = (Object *)value.data;
@@ -1396,7 +1401,8 @@ static PointerRNA rna_ParticleInstanceModifier_particle_system_get(PointerRNA *p
   return rptr;
 }
 
-static void rna_ParticleInstanceModifier_particle_system_set(PointerRNA *ptr,
+static void rna_ParticleInstanceModifier_particle_system_set(struct ReportList *UNUSED(reports),
+                                                             PointerRNA *ptr,
                                                              const PointerRNA value)
 {
   ParticleInstanceModifierData *psmd = ptr->data;
index 4906f8ac28e06447c919393ff9cb177fa2fe1186..17072a61bcd257d810948e27ad07d7f8ca24fd0c 100644 (file)
@@ -814,7 +814,9 @@ static PointerRNA rna_NodeTree_active_node_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Node, node);
 }
 
-static void rna_NodeTree_active_node_set(PointerRNA *ptr, const PointerRNA value)
+static void rna_NodeTree_active_node_set(struct ReportList *UNUSED(reports),
+                                         PointerRNA *ptr,
+                                         const PointerRNA value)
 {
   bNodeTree *ntree = (bNodeTree *)ptr->data;
   bNode *node = (bNode *)value.data;
@@ -1608,7 +1610,9 @@ static IDProperty *rna_Node_idprops(PointerRNA *ptr, bool create)
   return node->prop;
 }
 
-static void rna_Node_parent_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Node_parent_set(struct ReportList *UNUSED(reports),
+                                PointerRNA *ptr,
+                                PointerRNA value)
 {
   bNode *node = ptr->data;
   bNode *parent = value.data;
@@ -2683,7 +2687,9 @@ static void rna_NodeGroup_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
   ED_node_tag_update_nodetree(bmain, ntree, node);
 }
 
-static void rna_NodeGroup_node_tree_set(PointerRNA *ptr, const PointerRNA value)
+static void rna_NodeGroup_node_tree_set(struct ReportList *UNUSED(reports),
+                                        PointerRNA *ptr,
+                                        const PointerRNA value)
 {
   bNodeTree *ntree = ptr->id.data;
   bNode *node = ptr->data;
@@ -2791,7 +2797,9 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value)
   chroma->t2 = value;
 }
 
-static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Node_scene_set(struct ReportList *UNUSED(reports),
+                               PointerRNA *ptr,
+                               PointerRNA value)
 {
   bNode *node = (bNode *)ptr->data;
 
@@ -3345,7 +3353,9 @@ static PointerRNA rna_ShaderNodePointDensity_psys_get(PointerRNA *ptr)
   return value;
 }
 
-static void rna_ShaderNodePointDensity_psys_set(PointerRNA *ptr, PointerRNA value)
+static void rna_ShaderNodePointDensity_psys_set(struct ReportList *UNUSED(reports),
+                                                PointerRNA *ptr,
+                                                PointerRNA value)
 {
   bNode *node = ptr->data;
   NodeShaderTexPointDensity *shader_point_density = node->storage;
index b2cbfbbf6f0cb6a051d96f6f5a53336636b14d80..b445399609505a575c117456e0deb12c8b875fbd 100644 (file)
@@ -427,7 +427,7 @@ static void rna_Object_dependency_update(Main *bmain, Scene *UNUSED(scene), Poin
   WM_main_add_notifier(NC_OBJECT | ND_PARENT, ptr->id.data);
 }
 
-static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Object_data_set(struct ReportList *reports, PointerRNA *ptr, PointerRNA value)
 {
   Object *ob = (Object *)ptr->data;
   ID *id = value.data;
@@ -441,8 +441,13 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value)
     return;
   }
 
-  BLI_assert(BKE_id_is_in_global_main(&ob->id));
-  BLI_assert(BKE_id_is_in_global_main(id));
+  if ((id->tag & LIB_TAG_NO_MAIN) != (ob->id.tag & LIB_TAG_NO_MAIN)) {
+    BKE_report(reports,
+               RPT_ERROR,
+               "Can only assign evaluated data to to evaluated object, or original data to "
+               "original object");
+    return;
+  }
 
   if (ob->type == OB_EMPTY) {
     if (ob->data) {
@@ -529,7 +534,9 @@ static bool rna_Object_data_poll(PointerRNA *ptr, const PointerRNA value)
   return true;
 }
 
-static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Object_parent_set(struct ReportList *UNUSED(reports),
+                                  PointerRNA *ptr,
+                                  PointerRNA value)
 {
   Object *ob = (Object *)ptr->data;
   Object *par = (Object *)value.data;
@@ -614,7 +621,9 @@ static const EnumPropertyItem *rna_Object_instance_type_itemf(bContext *UNUSED(C
   return item;
 }
 
-static void rna_Object_dup_collection_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Object_dup_collection_set(struct ReportList *UNUSED(reports),
+                                          PointerRNA *ptr,
+                                          PointerRNA value)
 {
   Object *ob = (Object *)ptr->data;
   Collection *grp = (Collection *)value.data;
@@ -890,7 +899,9 @@ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
 }
 
-static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Object_active_material_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   Object *ob = (Object *)ptr->id.data;
 
@@ -1089,7 +1100,9 @@ static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
 }
 
-static void rna_MaterialSlot_material_set(PointerRNA *ptr, PointerRNA value)
+static void rna_MaterialSlot_material_set(struct ReportList *UNUSED(reports),
+                                          PointerRNA *ptr,
+                                          PointerRNA value)
 {
   Object *ob = (Object *)ptr->id.data;
   int index = (Material **)ptr->data - ob->mat;
@@ -1277,7 +1290,9 @@ static PointerRNA rna_Object_active_constraint_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
 }
 
-static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Object_active_constraint_set(struct ReportList *UNUSED(reports),
+                                             PointerRNA *ptr,
+                                             PointerRNA value)
 {
   Object *ob = (Object *)ptr->id.data;
   BKE_constraints_active_set(&ob->constraints, (bConstraint *)value.data);
index 7b35092dea4e28b8275e2a9b0aaff8be7e059c91..cd6ed9bc7e4be53541baf44c2e25fe83eb3a4295 100644 (file)
@@ -74,7 +74,9 @@ static PointerRNA rna_Palette_active_color_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, NULL, NULL);
 }
 
-static void rna_Palette_active_color_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Palette_active_color_set(struct ReportList *UNUSED(reports),
+                                         PointerRNA *ptr,
+                                         PointerRNA value)
 {
   Palette *palette = ptr->data;
   PaletteColor *color = value.data;
index 8c3d16f9c8c675497cbbc960d309541e9096961f..9ef5bcd4fd117349e98b05e154c05efeb66c778f 100644 (file)
@@ -792,7 +792,9 @@ static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part);
 }
 
-static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
+static void rna_particle_settings_set(struct ReportList *UNUSED(reports),
+                                      PointerRNA *ptr,
+                                      PointerRNA value)
 {
   Object *ob = ptr->id.data;
   ParticleSystem *psys = (ParticleSystem *)ptr->data;
@@ -1318,7 +1320,9 @@ static PointerRNA rna_ParticleSettings_active_texture_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
 }
 
-static void rna_ParticleSettings_active_texture_set(PointerRNA *ptr, PointerRNA value)
+static void rna_ParticleSettings_active_texture_set(struct ReportList *UNUSED(reports),
+                                                    PointerRNA *ptr,
+                                                    PointerRNA value)
 {
   ParticleSettings *part = (ParticleSettings *)ptr->data;
 
index 2f7f8c707602d41fb37db154de13201ccc6ece06..7b91248feac51d5832bf7ed0cf2ad59ae5089e82 100644 (file)
@@ -373,7 +373,9 @@ static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr)
   rna_Itasc_update(bmain, scene, ptr);
 }
 
-static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, PointerRNA value)
+static void rna_PoseChannel_bone_custom_set(struct ReportList *UNUSED(reports),
+                                            PointerRNA *ptr,
+                                            PointerRNA value)
 {
   bPoseChannel *pchan = (bPoseChannel *)ptr->data;
 
@@ -402,7 +404,9 @@ static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, grp);
 }
 
-static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value)
+static void rna_PoseChannel_bone_group_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   Object *ob = (Object *)ptr->id.data;
   bPose *pose = (ob) ? ob->pose : NULL;
@@ -443,7 +447,9 @@ static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr)
       ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group - 1));
 }
 
-static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Pose_active_bone_group_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   bPose *pose = (bPose *)ptr->data;
   pose->active_group = BLI_findindex(&pose->agroups, value.data) + 1;
@@ -532,7 +538,9 @@ static PointerRNA rna_PoseChannel_active_constraint_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
 }
 
-static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA value)
+static void rna_PoseChannel_active_constraint_set(struct ReportList *UNUSED(reports),
+                                                  PointerRNA *ptr,
+                                                  PointerRNA value)
 {
   bPoseChannel *pchan = (bPoseChannel *)ptr->data;
   BKE_constraints_active_set(&pchan->constraints, (bConstraint *)value.data);
@@ -770,7 +778,9 @@ static bPoseChannel *rna_PoseChannel_ensure_own_pchan(Object *ob,
   return ref_pchan;
 }
 
-static void rna_PoseChannel_custom_shape_transform_set(PointerRNA *ptr, PointerRNA value)
+static void rna_PoseChannel_custom_shape_transform_set(struct ReportList *UNUSED(reports),
+                                                       PointerRNA *ptr,
+                                                       PointerRNA value)
 {
   bPoseChannel *pchan = (bPoseChannel *)ptr->data;
   Object *ob = (Object *)ptr->id.data;
index 032a1f86fc01ebe99a5fe3e1fc8f8d972497d4b2..c5eff47c3aa5ea5f889c713229a35647e79565f8 100644 (file)
@@ -2373,7 +2373,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
 
       switch (override_op) {
         case IDOVERRIDESTATIC_OP_REPLACE:
-          RNA_property_pointer_set(ptr_dst, prop_dst, value);
+          RNA_property_pointer_set(NULL, ptr_dst, prop_dst, value);
           break;
         default:
           BLI_assert(0 && "Unsupported RNA override operation on pointer");
index 5733b31e02c277c4b350d0ee1ea2ccc0c5805e77..4584cadb51d6517b76e0720b58d3a2d2d907f605 100644 (file)
@@ -772,7 +772,9 @@ static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
 
 /* End of read-only Iterator of all the scene objects. */
 
-static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Scene_set_set(struct ReportList *UNUSED(reports),
+                              PointerRNA *ptr,
+                              PointerRNA value)
 {
   Scene *scene = (Scene *)ptr->data;
   Scene *set = (Scene *)value.data;
@@ -969,7 +971,9 @@ static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
 }
 
-static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Scene_active_keying_set_set(struct ReportList *UNUSED(reports),
+                                            PointerRNA *ptr,
+                                            PointerRNA value)
 {
   Scene *scene = (Scene *)ptr->data;
   KeyingSet *ks = (KeyingSet *)value.data;
@@ -1435,7 +1439,9 @@ static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderView, srv);
 }
 
-static void rna_RenderSettings_active_view_set(PointerRNA *ptr, PointerRNA value)
+static void rna_RenderSettings_active_view_set(struct ReportList *UNUSED(reports),
+                                               PointerRNA *ptr,
+                                               PointerRNA value)
 {
   RenderData *rd = (RenderData *)ptr->data;
   SceneRenderView *srv = (SceneRenderView *)value.data;
@@ -2040,7 +2046,9 @@ PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineStyle, lineset->linestyle);
 }
 
-void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value)
+void rna_FreestyleLineSet_linestyle_set(struct ReportList *UNUSED(reports),
+                                        PointerRNA *ptr,
+                                        PointerRNA value)
 {
   FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
 
index 2af06fc46848bcf220f7fb2cf9d559bdbfbf4ef6..687ba96abc2cde9712b42b466ecdfe1275a115c5 100644 (file)
@@ -465,7 +465,9 @@ static void rna_SequenceCrop_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P
   BKE_sequence_invalidate_cache(scene, seq);
 }
 
-static void rna_Sequence_text_font_set(PointerRNA *ptr, PointerRNA ptr_value)
+static void rna_Sequence_text_font_set(struct ReportList *UNUSED(reports),
+                                       PointerRNA *ptr,
+                                       PointerRNA ptr_value)
 {
   Sequence *seq = ptr->data;
   TextVars *data = seq->effectdata;
index 06c968534cce900af77ae3927385e0f49251b42d..8696023fbe6d1184a11119fe6d46e906e0fac13a 100644 (file)
@@ -185,7 +185,8 @@ static void shaderfx_object_set(Object *self, Object **ob_p, int type, PointerRN
 }
 
 #  define RNA_FX_OBJECT_SET(_type, _prop, _obtype) \
-    static void rna_##_type##ShaderFx_##_prop##_set(PointerRNA *ptr, PointerRNA value) \
+    static void rna_##_type##ShaderFx_##_prop##_set( \
+        struct ReportList *UNUSED(reports), PointerRNA *ptr, PointerRNA value) \
     { \
       _type##ShaderFxData *tmd = (_type##ShaderFxData *)ptr->data; \
       shaderfx_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \
index 6163084ce8dea1e45ed9fe9b8aed65e2dae8be2c..0611cca7652bbbda0f335c8470cc16610e28c232 100644 (file)
@@ -1329,7 +1329,9 @@ static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
   return ED_space_image_check_show_maskedit(sima, view_layer);
 }
 
-static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceImageEditor_image_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   SpaceImage *sima = (SpaceImage *)(ptr->data);
   bScreen *sc = (bScreen *)ptr->id.data;
@@ -1341,7 +1343,9 @@ static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
   ED_space_image_set(G_MAIN, sima, obedit, (Image *)value.data, false);
 }
 
-static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceImageEditor_mask_set(struct ReportList *UNUSED(reports),
+                                          PointerRNA *ptr,
+                                          PointerRNA value)
 {
   SpaceImage *sima = (SpaceImage *)(ptr->data);
 
@@ -1507,7 +1511,9 @@ static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, bool value)
   st->left = 0;
 }
 
-static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceTextEditor_text_set(struct ReportList *UNUSED(reports),
+                                         PointerRNA *ptr,
+                                         PointerRNA value)
 {
   SpaceText *st = (SpaceText *)(ptr->data);
 
@@ -1529,7 +1535,9 @@ static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain),
 /* Space Properties */
 
 /* note: this function exists only to avoid id refcounting */
-static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceProperties_pin_id_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
   sbuts->pinid = value.data;
@@ -1731,7 +1739,9 @@ static void rna_ConsoleLine_cursor_index_range(
 
 /* Space Dopesheet */
 
-static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceDopeSheetEditor_action_set(struct ReportList *UNUSED(reports),
+                                                PointerRNA *ptr,
+                                                PointerRNA value)
 {
   SpaceAction *saction = (SpaceAction *)(ptr->data);
   bAction *act = (bAction *)value.data;
@@ -1953,7 +1963,9 @@ static void rna_Sequencer_view_type_update(Main *UNUSED(bmain),
 
 /* Space Node Editor */
 
-static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr, const PointerRNA value)
+static void rna_SpaceNodeEditor_node_tree_set(struct ReportList *UNUSED(reports),
+                                              PointerRNA *ptr,
+                                              const PointerRNA value)
 {
   SpaceNode *snode = (SpaceNode *)ptr->data;
   ED_node_tree_start(snode, (bNodeTree *)value.data, NULL, NULL);
@@ -2064,7 +2076,9 @@ static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode,
   snode->cursor[1] /= UI_DPI_FAC;
 }
 
-static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceClipEditor_clip_set(struct ReportList *UNUSED(reports),
+                                         PointerRNA *ptr,
+                                         PointerRNA value)
 {
   SpaceClip *sc = (SpaceClip *)(ptr->data);
   bScreen *screen = (bScreen *)ptr->id.data;
@@ -2072,7 +2086,9 @@ static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
   ED_space_clip_set_clip(NULL, screen, sc, (MovieClip *)value.data);
 }
 
-static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr, PointerRNA value)
+static void rna_SpaceClipEditor_mask_set(struct ReportList *UNUSED(reports),
+                                         PointerRNA *ptr,
+                                         PointerRNA value)
 {
   SpaceClip *sc = (SpaceClip *)(ptr->data);
 
index 1fbdac9df389a7b8cd5d2ff82b1ea39a81589802..9be277aa15f5e8fb269fa537356ff21fb870eeed 100644 (file)
@@ -144,7 +144,9 @@ static PointerRNA rna_tracking_active_track_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingTrack, act_track);
 }
 
-static void rna_tracking_active_track_set(PointerRNA *ptr, PointerRNA value)
+static void rna_tracking_active_track_set(struct ReportList *UNUSED(reports),
+                                          PointerRNA *ptr,
+                                          PointerRNA value)
 {
   MovieClip *clip = (MovieClip *)ptr->id.data;
   MovieTrackingTrack *track = (MovieTrackingTrack *)value.data;
@@ -165,7 +167,9 @@ static PointerRNA rna_tracking_active_plane_track_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingPlaneTrack, act_plane_track);
 }
 
-static void rna_tracking_active_plane_track_set(PointerRNA *ptr, PointerRNA value)
+static void rna_tracking_active_plane_track_set(struct ReportList *UNUSED(reports),
+                                                PointerRNA *ptr,
+                                                PointerRNA value)
 {
   MovieClip *clip = (MovieClip *)ptr->id.data;
   MovieTrackingPlaneTrack *plane_track = (MovieTrackingPlaneTrack *)value.data;
@@ -476,7 +480,9 @@ static PointerRNA rna_tracking_active_object_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingObject, object);
 }
 
-static void rna_tracking_active_object_set(PointerRNA *ptr, PointerRNA value)
+static void rna_tracking_active_object_set(struct ReportList *UNUSED(reports),
+                                           PointerRNA *ptr,
+                                           PointerRNA value)
 {
   MovieClip *clip = (MovieClip *)ptr->id.data;
   MovieTrackingObject *object = (MovieTrackingObject *)value.data;
index e4af1b549d62be0c0613ae29a3616952a072d6c0..f3080d6f65926f5ab081c254f61689135a9089e2 100644 (file)
@@ -694,7 +694,9 @@ static PointerRNA rna_PieMenu_layout_get(PointerRNA *ptr)
   return rptr;
 }
 
-static void rna_Window_scene_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Window_scene_set(struct ReportList *UNUSED(reports),
+                                 PointerRNA *ptr,
+                                 PointerRNA value)
 {
   wmWindow *win = ptr->data;
 
@@ -738,7 +740,9 @@ static PointerRNA rna_Window_workspace_get(PointerRNA *ptr)
       ptr, &RNA_WorkSpace, BKE_workspace_active_get(win->workspace_hook));
 }
 
-static void rna_Window_workspace_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Window_workspace_set(struct ReportList *UNUSED(reports),
+                                     PointerRNA *ptr,
+                                     PointerRNA value)
 {
   wmWindow *win = (wmWindow *)ptr->data;
 
@@ -774,7 +778,9 @@ PointerRNA rna_Window_screen_get(PointerRNA *ptr)
       ptr, &RNA_Screen, BKE_workspace_active_screen_get(win->workspace_hook));
 }
 
-static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Window_screen_set(struct ReportList *UNUSED(reports),
+                                  PointerRNA *ptr,
+                                  PointerRNA value)
 {
   wmWindow *win = ptr->data;
   WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook);
@@ -824,7 +830,9 @@ static PointerRNA rna_Window_view_layer_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(&scene_ptr, &RNA_ViewLayer, view_layer);
 }
 
-static void rna_Window_view_layer_set(PointerRNA *ptr, PointerRNA value)
+static void rna_Window_view_layer_set(struct ReportList *UNUSED(reports),
+                                      PointerRNA *ptr,
+                                      PointerRNA value)
 {
   wmWindow *win = ptr->data;
   ViewLayer *view_layer = value.data;
@@ -1028,7 +1036,9 @@ static PointerRNA rna_WindowManager_active_keyconfig_get(PointerRNA *ptr)
   return rna_pointer_inherit_refine(ptr, &RNA_KeyConfig, kc);
 }
 
-static void rna_WindowManager_active_keyconfig_set(PointerRNA *ptr, PointerRNA value)
+static void rna_WindowManager_active_keyconfig_set(struct ReportList *UNUSED(reports),
+                                                   PointerRNA *ptr,
+                                                   PointerRNA value)
 {
   wmWindowManager *wm = ptr->data;
   wmKeyConfig *kc = value.data;
index 819dc3ac495798f22762aef482bf75b9802d3570..e5487a6a0c9a36bf808ebd1c5f36bb1b1fdc0739 100644 (file)
@@ -2029,7 +2029,15 @@ static int pyrna_py_to_prop(
           else {
             /* data == NULL, assign to RNA */
             if (value == Py_None || RNA_struct_is_a(param->ptr.type, ptr_type)) {
-              RNA_property_pointer_set(ptr, prop, value == Py_None ? PointerRNA_NULL : param->ptr);
+              ReportList reports;
+              BKE_reports_init(&reports, RPT_STORE);
+              RNA_property_pointer_set(
+                  &reports, ptr, prop, value == Py_None ? PointerRNA_NULL : param->ptr);
+              int err = (BPy_reports_to_error(&reports, PyExc_RuntimeError, true));
+              if (err == -1) {
+                Py_XDECREF(value_new);
+                return -1;
+              }
             }
             else {
               raise_error = true;