diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 12:08:02 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 12:08:02 +0300 |
commit | 17f458ff320c5c0a0c5cdaeb5da60926d3e03d68 (patch) | |
tree | a67031752a7f2011e5cd4ee6b761eb0ad1a274e8 /source/blender/makesrna | |
parent | fcfe1963a622fed257b8b9597424bf11edb19c52 (diff) | |
parent | 24d1829243c6e41c639c1d0722a13599a7c1927c (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_vfont_api.c | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 7f0ddf04724..bcac4b7e9a6 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -61,9 +61,9 @@ #include "MEM_guardedalloc.h" -static void rna_ImagePackedFile_save(ImagePackedFile *imapf, ReportList *reports) +static void rna_ImagePackedFile_save(ImagePackedFile *imapf, Main *bmain, ReportList *reports) { - if (writePackedFile(reports, imapf->filepath, imapf->packedfile, 0) != RET_OK) { + if (writePackedFile(reports, bmain->name, imapf->filepath, imapf->packedfile, 0) != RET_OK) { BKE_reportf(reports, RPT_ERROR, "Could not save packed file to disk as '%s'", imapf->filepath); } @@ -174,7 +174,7 @@ static void rna_Image_pack( WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image); } -static void rna_Image_unpack(Image *image, ReportList *reports, int method) +static void rna_Image_unpack(Image *image, Main *bmain, ReportList *reports, int method) { if (!BKE_image_has_packedfile(image)) { BKE_report(reports, RPT_ERROR, "Image not packed"); @@ -185,7 +185,7 @@ static void rna_Image_unpack(Image *image, ReportList *reports, int method) } else { /* reports its own error on failure */ - unpackImage(reports, image, method); + unpackImage(bmain, reports, image, method); } } @@ -301,7 +301,7 @@ void RNA_api_image_packed_file(StructRNA *srna) func = RNA_def_function(srna, "save", "rna_ImagePackedFile_save"); RNA_def_function_ui_description(func, "Save the packed file to its filepath"); - RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); } void RNA_api_image(StructRNA *srna) @@ -331,7 +331,7 @@ void RNA_api_image(StructRNA *srna) func = RNA_def_function(srna, "unpack", "rna_Image_unpack"); RNA_def_function_ui_description(func, "Save an image packed in the .blend file to disk"); - RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); 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"); diff --git a/source/blender/makesrna/intern/rna_vfont_api.c b/source/blender/makesrna/intern/rna_vfont_api.c index 6a2a7f3ffad..b93fc1a0053 100644 --- a/source/blender/makesrna/intern/rna_vfont_api.c +++ b/source/blender/makesrna/intern/rna_vfont_api.c @@ -43,14 +43,14 @@ static void rna_VectorFont_pack(VFont *vfont, Main *bmain, ReportList *reports) vfont->packedfile = newPackedFile(reports, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); } -static void rna_VectorFont_unpack(VFont *vfont, ReportList *reports, int method) +static void rna_VectorFont_unpack(VFont *vfont, Main *bmain, ReportList *reports, int method) { if (!vfont->packedfile) { BKE_report(reports, RPT_ERROR, "Font not packed"); } else { /* reports its own error on failure */ - unpackVFont(reports, vfont, method); + unpackVFont(bmain, reports, vfont, method); } } @@ -62,11 +62,11 @@ void RNA_api_vfont(StructRNA *srna) func = RNA_def_function(srna, "pack", "rna_VectorFont_pack"); RNA_def_function_ui_description(func, "Pack the font into the current blend file"); - RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_MAIN); + RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); func = RNA_def_function(srna, "unpack", "rna_VectorFont_unpack"); RNA_def_function_ui_description(func, "Unpack the font to the samples filename"); - RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); RNA_def_enum(func, "method", rna_enum_unpack_method_items, PF_USE_LOCAL, "method", "How to unpack"); } |