Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-05-28 00:00:33 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-05-28 00:01:09 +0400
commit1c5ffdd55e7a65e62b76f9efcfb1bb88f88eac00 (patch)
tree5eacbaaf9b4f9e21e60eb0eba6eeb6cab101cde0 /source/blender/makesrna/intern
parentf469185f2540378cf0cec9af11e94015f83ecbe1 (diff)
Fix T40387, image api save and pack did not fire notifiers.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index 57d74c91c86..1fb46c009a0 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -109,7 +109,7 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
}
}
-static void rna_Image_save(Image *image, ReportList *reports)
+static void rna_Image_save(Image *image, bContext *C, ReportList *reports)
{
ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL);
if (ibuf) {
@@ -141,9 +141,10 @@ static void rna_Image_save(Image *image, ReportList *reports)
}
BKE_image_release_ibuf(image, ibuf, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image);
}
-static void rna_Image_pack(Image *image, ReportList *reports, int as_png)
+static void rna_Image_pack(Image *image, bContext *C, ReportList *reports, int as_png)
{
ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL);
@@ -160,6 +161,7 @@ static void rna_Image_pack(Image *image, ReportList *reports, int as_png)
}
BKE_image_release_ibuf(image, ibuf, NULL);
+ WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image);
}
static void rna_Image_unpack(Image *image, ReportList *reports, int method)
@@ -299,11 +301,11 @@ void RNA_api_image(StructRNA *srna)
func = RNA_def_function(srna, "save", "rna_Image_save");
RNA_def_function_ui_description(func, "Save image to its source path");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
func = RNA_def_function(srna, "pack", "rna_Image_pack");
RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file");
- RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
RNA_def_boolean(func, "as_png", 0, "as_png", "Pack the image as PNG (needed for generated/dirty images)");
func = RNA_def_function(srna, "unpack", "rna_Image_unpack");