diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-11 16:40:37 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-11 16:40:37 +0300 |
commit | 78a8d3685bd3487eb0b5dd55793f94fe7235e377 (patch) | |
tree | 77f9ba0ddd9613eb7e9dbb8e0402f977548a281f /source/blender/makesrna/intern | |
parent | b763c34e80d3b20f9a7f0a592e479e5fa7ab295f (diff) |
Cleanup: remove moar ugly G.main usages...
BKE_image was an ugly nest, could fix all but the ones from compositor,
so moved ugly G.main there, at least we know where the Evil is that way ;)
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_color.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_image.c | 22 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 4 |
6 files changed, 19 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index dbd61cf6450..1d85ba43995 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -583,7 +583,7 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, Scene DAG_id_tag_update(&ima->id, 0); - BKE_image_signal(ima, NULL, IMA_SIGNAL_COLORMANAGE); + BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_COLORMANAGE); WM_main_add_notifier(NC_IMAGE | ND_DISPLAY, &ima->id); WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 741e3dfae60..bab8c18439f 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -104,12 +104,12 @@ static void rna_Image_source_set(PointerRNA *ptr, int value) if (value != ima->source) { ima->source = value; - BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE); + BKE_image_signal(G.main, ima, NULL, IMA_SIGNAL_SRC_CHANGE); DAG_id_tag_update(&ima->id, 0); } } -static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Image_fields_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Image *ima = ptr->id.data; ImBuf *ibuf; @@ -124,36 +124,36 @@ static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P if ((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr = 1; if (nr) - BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); + BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE); } BKE_image_release_ibuf(ima, ibuf, lock); } -static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Image_reload_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Image *ima = ptr->id.data; - BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD); + BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_RELOAD); WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); DAG_id_tag_update(&ima->id, 0); } -static void rna_Image_generated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Image_generated_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Image *ima = ptr->id.data; - BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); + BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE); } -static void rna_Image_colormanage_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Image_colormanage_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Image *ima = ptr->id.data; - BKE_image_signal(ima, NULL, IMA_SIGNAL_COLORMANAGE); + BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_COLORMANAGE); DAG_id_tag_update(&ima->id, 0); WM_main_add_notifier(NC_IMAGE | ND_DISPLAY, &ima->id); WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); } -static void rna_Image_views_format_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) +static void rna_Image_views_format_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Image *ima = ptr->id.data; ImBuf *ibuf; @@ -164,7 +164,7 @@ static void rna_Image_views_format_update(Main *UNUSED(bmain), Scene *scene, Poi if (ibuf) { ImageUser iuser = {NULL}; iuser.scene = scene; - BKE_image_signal(ima, &iuser, IMA_SIGNAL_FREE); + BKE_image_signal(bmain, ima, &iuser, IMA_SIGNAL_FREE); } BKE_image_release_ibuf(ima, ibuf, lock); diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index b50e263e01d..cb8fa6c6c85 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -192,9 +192,9 @@ static void rna_Image_unpack(Image *image, Main *bmain, ReportList *reports, int } } -static void rna_Image_reload(Image *image) +static void rna_Image_reload(Image *image, Main *bmain) { - BKE_image_signal(image, NULL, IMA_SIGNAL_RELOAD); + BKE_image_signal(bmain, image, NULL, IMA_SIGNAL_RELOAD); } static void rna_Image_update(Image *image, ReportList *reports) @@ -336,6 +336,7 @@ void RNA_api_image(StructRNA *srna) RNA_def_enum(func, "method", rna_enum_unpack_method_items, PF_USE_LOCAL, "method", "How to unpack"); func = RNA_def_function(srna, "reload", "rna_Image_reload"); + RNA_def_function_flag(func, FUNC_USE_MAIN); RNA_def_function_ui_description(func, "Reload the image from its source path"); func = RNA_def_function(srna, "update", "rna_Image_update"); diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 7d5c327f25a..6d5ec5f508e 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -338,7 +338,7 @@ static Image *rna_Main_images_load(Main *bmain, ReportList *reports, const char errno = 0; if (check_existing) { - ima = BKE_image_load_exists(filepath); + ima = BKE_image_load_exists(bmain, filepath); } else { ima = BKE_image_load(bmain, filepath); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index e2a581821f3..9bb5117cba3 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2634,7 +2634,7 @@ static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *p ImageUser *iuser = node->storage; BKE_image_multilayer_index(ima->rr, iuser); - BKE_image_signal(ima, iuser, IMA_SIGNAL_SRC_CHANGE); + BKE_image_signal(bmain, ima, iuser, IMA_SIGNAL_SRC_CHANGE); rna_Node_update(bmain, scene, ptr); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index cb5844f1b03..8db03d7a437 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2141,7 +2141,7 @@ static void rna_GPUDOFSettings_update(Main *UNUSED(bmain), Scene *scene, Pointer WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); } -static void rna_Stereo3dFormat_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Stereo3dFormat_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; @@ -2156,7 +2156,7 @@ static void rna_Stereo3dFormat_update(Main *UNUSED(bmain), Scene *UNUSED(scene), ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock); if (ibuf) { - BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); + BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE); } BKE_image_release_ibuf(ima, ibuf, lock); } |