Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-06-19 08:41:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-19 09:47:12 +0300
commitfade37ff07ab3b62844068a1a5d60dd74ea787f6 (patch)
treea3d8903572491de4e00bbee91c9dbe0877fc10e3 /source/blender/blenloader/BLO_writefile.h
parent5a77f643f45bdd52a70aecf7b09d8836d540b5a1 (diff)
Writefile: move file flags to BlendFileWriteParams
This removes G_FILE_HISTORY, G_FILE_SAVE_COPY & G_FILE_USERPREFS. Using file-flags made logic harder to follow since it's not so clear which flags are expected to be in G.fileflags & which are meant to be set and passed as arguments, these are shared between read & write functions too. Add BlendFileWriteParams so options which don't need to be stored aren't mixed up with flags that are stored for reuse.
Diffstat (limited to 'source/blender/blenloader/BLO_writefile.h')
-rw-r--r--source/blender/blenloader/BLO_writefile.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/blenloader/BLO_writefile.h b/source/blender/blenloader/BLO_writefile.h
index 18783474392..32cb6633c12 100644
--- a/source/blender/blenloader/BLO_writefile.h
+++ b/source/blender/blenloader/BLO_writefile.h
@@ -35,25 +35,30 @@ struct ReportList;
*/
typedef enum eBLO_WritePathRemap {
/** No path manipulation. */
- BLO_WRITE_PATH_REMAP_NONE = 1,
+ BLO_WRITE_PATH_REMAP_NONE = 0,
/** Remap existing relative paths (default). */
- BLO_WRITE_PATH_REMAP_RELATIVE = 2,
+ BLO_WRITE_PATH_REMAP_RELATIVE = 1,
/** Remap paths making all paths relative to the new location. */
- BLO_WRITE_PATH_REMAP_RELATIVE_ALL = 3,
+ BLO_WRITE_PATH_REMAP_RELATIVE_ALL = 2,
/** Make all paths absolute. */
- BLO_WRITE_PATH_REMAP_ABSOLUTE = 4,
+ BLO_WRITE_PATH_REMAP_ABSOLUTE = 3,
} eBLO_WritePathRemap;
-extern bool BLO_write_file_ex(struct Main *mainvar,
- const char *filepath,
- const int write_flags,
- struct ReportList *reports,
- /* Extra arguments. */
- eBLO_WritePathRemap remap_mode,
- const struct BlendThumbnail *thumb);
+/** Similar to #BlendFileReadParams. */
+struct BlendFileWriteParams {
+ eBLO_WritePathRemap remap_mode;
+ /** Save `.blend1`, `.blend2`... etc. */
+ uint use_save_versions : 1;
+ /** On write, restore paths after editing them (see #BLO_WRITE_PATH_REMAP_RELATIVE). */
+ uint use_save_as_copy : 1;
+ uint use_userdef : 1;
+ const struct BlendThumbnail *thumb;
+};
+
extern bool BLO_write_file(struct Main *mainvar,
const char *filepath,
const int write_flags,
+ const struct BlendFileWriteParams *params,
struct ReportList *reports);
extern bool BLO_write_file_mem(struct Main *mainvar,