diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-08 20:50:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-08 20:50:55 +0300 |
commit | 1f1245a92a21b4744495549b951caf59fea06765 (patch) | |
tree | 941b6c2cdf7923b445b032996dc7f80591cc6f26 /source/blender/editors/space_info | |
parent | 5dffae2346208d7b8185afb99d7ba0465214a515 (diff) |
Remap Relative paths save option.
If you have a blend file and want to save in a new directory enabling this will save with the paths corrected relative to the new directory.
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/info_ops.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 13bcd3276af..81506d42d87 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -196,21 +196,12 @@ void FILE_OT_unpack_all(wmOperatorType *ot) static int make_paths_relative_exec(bContext *C, wmOperator *op) { - char txtname[24]; /* text block name */ - int tot, changed, failed, linked; - if(!G.relbase_valid) { BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file."); return OPERATOR_CANCELLED; } - txtname[0] = '\0'; - makeFilesRelative(txtname, &tot, &changed, &failed, &linked); - - if(failed) - BKE_reportf(op->reports, RPT_ERROR, "Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); - else - BKE_reportf(op->reports, RPT_INFO, "Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + makeFilesRelative(G.sce, op->reports); return OPERATOR_FINISHED; } @@ -232,22 +223,12 @@ void FILE_OT_make_paths_relative(wmOperatorType *ot) static int make_paths_absolute_exec(bContext *C, wmOperator *op) { - char txtname[24]; /* text block name */ - int tot, changed, failed, linked; - if(!G.relbase_valid) { BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file."); return OPERATOR_CANCELLED; } - txtname[0] = '\0'; - makeFilesAbsolute(txtname, &tot, &changed, &failed, &linked); - - if(failed) - BKE_reportf(op->reports, RPT_ERROR, "Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); - else - BKE_reportf(op->reports, RPT_INFO, "Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - + makeFilesAbsolute(G.sce, op->reports); return OPERATOR_FINISHED; } @@ -273,12 +254,7 @@ static int report_missing_files_exec(bContext *C, wmOperator *op) txtname[0] = '\0'; /* run the missing file check */ - checkMissingFiles(txtname); - - if(txtname[0] == '\0') - BKE_report(op->reports, RPT_INFO, "No external files missing."); - else - BKE_reportf(op->reports, RPT_ERROR, "Missing files listed in Text \"%s\"", txtname); + checkMissingFiles(G.sce, op->reports); return OPERATOR_FINISHED; } @@ -303,7 +279,7 @@ static int find_missing_files_exec(bContext *C, wmOperator *op) char *path; path= RNA_string_get_alloc(op->ptr, "path", NULL, 0); - findMissingFiles(path); + findMissingFiles(path, G.sce); MEM_freeN(path); return OPERATOR_FINISHED; |