diff options
author | Martin Poirier <theeth@yahoo.com> | 2010-01-08 20:47:27 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2010-01-08 20:47:27 +0300 |
commit | 5dffae2346208d7b8185afb99d7ba0465214a515 (patch) | |
tree | 78f38887a5b2ef070f4afbf4965123430b1d7b7d /source/blender/makesrna/intern/rna_image_api.c | |
parent | b504a48854aa2fb90264795aee7aedcfde498ca6 (diff) |
RNA Function Save Image accepts a Scene as optional argument (for image parameters). It uses the scene in context otherwise.
Diffstat (limited to 'source/blender/makesrna/intern/rna_image_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index b8be2da4579..34e2fc06ad7 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -63,10 +63,13 @@ static char *rna_Image_get_export_path(Image *image, char *dest_dir, int rel) return path; } -static void rna_Image_save(Image *image, bContext *C, ReportList *reports, char *path) +static void rna_Image_save(Image *image, bContext *C, ReportList *reports, char *path, Scene *scene) { ImBuf *ibuf; - Scene *scene = CTX_data_scene(C); + + if (scene == NULL) { + scene = CTX_data_scene(C); + } if (scene) { ImageUser iuser; @@ -127,6 +130,7 @@ void RNA_api_image(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_string(func, "path", "", 0, "", "Save path."); RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from."); } #endif |