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.
This commit is contained in:
2010-01-08 17:50:55 +00:00
parent 5dffae2346
commit 1f1245a92a
6 changed files with 100 additions and 127 deletions

View File

@@ -1535,10 +1535,10 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
fileflags= G.fileflags;
/* set compression flag */
if(RNA_boolean_get(op->ptr, "compress"))
fileflags |= G_FILE_COMPRESS;
else
fileflags &= ~G_FILE_COMPRESS;
if(RNA_boolean_get(op->ptr, "compress")) fileflags |= G_FILE_COMPRESS;
else fileflags &= ~G_FILE_COMPRESS;
if(RNA_boolean_get(op->ptr, "relative_remap")) fileflags |= G_FILE_RELATIVE_REMAP;
else fileflags &= ~G_FILE_RELATIVE_REMAP;
WM_write_file(C, path, fileflags, op->reports);
@@ -1559,6 +1559,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot)
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file.");
RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory.");
}
/* *************** save file directly ******** */
@@ -1597,6 +1598,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file.");
RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory.");
}