diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-26 14:50:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-26 14:50:59 +0300 |
commit | 878d8b44ee24e1832a33a2c3388052b505bc4524 (patch) | |
tree | d11028bd4f53c5c34f805e060c47914eeef17640 /source/blender/makesrna/intern/rna_image_api.c | |
parent | 3ea627245b5a03db3010b16f2ef7edcafacbfc8e (diff) |
remove rna functions image.get_export_path() and image.get_abs_filename(), filename functions should not be spesific to images.
rename BKE_get_image_export_path() to BKE_rebase_path() and take a filename arg rather then an image.
obj export file copy was also not working because of a missing import.
Diffstat (limited to 'source/blender/makesrna/intern/rna_image_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index e394fd4f710..e87ec02daea 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -45,24 +45,6 @@ #include "MEM_guardedalloc.h" -/* - User should check if returned path exists before copying a file there. - - TODO: it would be better to return a (abs, rel) tuple. -*/ -static char *rna_Image_get_export_path(Image *image, char *dest_dir, int rel) -{ - int length = FILE_MAX; - char *path= MEM_callocN(length, "image file path"); - - if (!BKE_get_image_export_path(image, dest_dir, rel ? NULL : path, length, rel ? path : NULL, length )) { - MEM_freeN(path); - return NULL; - } - - return path; -} - static void rna_Image_save(Image *image, bContext *C, ReportList *reports, char *path, Scene *scene) { ImBuf *ibuf; @@ -92,17 +74,6 @@ static void rna_Image_save(Image *image, bContext *C, ReportList *reports, char } } -char *rna_Image_get_abs_filename(Image *image, bContext *C) -{ - char *filename= MEM_callocN(FILE_MAX, "Image.get_abs_filename()"); - - BLI_strncpy(filename, image->name, FILE_MAXDIR + FILE_MAXFILE); - BLI_convertstringcode(filename, CTX_data_main(C)->name); - BLI_convertstringframe(filename, CTX_data_scene(C)->r.cfra, 0); - - return filename; -} - #else void RNA_api_image(StructRNA *srna) @@ -110,21 +81,6 @@ void RNA_api_image(StructRNA *srna) FunctionRNA *func; PropertyRNA *parm; - func= RNA_def_function(srna, "get_export_path", "rna_Image_get_export_path"); - RNA_def_function_ui_description(func, "Produce image export path."); - parm= RNA_def_string(func, "dest_dir", "", 0, "", "Destination directory."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "get_rel_path", 1, "", "Return relative path if True."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "path", "", 0, "", "Absolute export path."); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "get_abs_filename", "rna_Image_get_abs_filename"); - RNA_def_function_ui_description(func, "Get absolute filename."); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); - parm= RNA_def_string_file_path(func, "abs_filename", NULL, 0, "", "Image/movie absolute filename."); - RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "save", "rna_Image_save"); RNA_def_function_ui_description(func, "Save image to a specific path."); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); |