1 /* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 2 5 * of the License, or (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software Foundation, 14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 * 16 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 17 * All rights reserved. 18 */ 19 20 #pragma once 21 22 /** \file 23 * \ingroup blenloader 24 * \brief external writefile function prototypes. 25 */ 26 27 struct BlendThumbnail; 28 struct Main; 29 struct MemFile; 30 struct ReportList; 31 32 /* -------------------------------------------------------------------- */ 33 /** \name BLO Write File API 34 * 35 * \see #BLO_read_from_file for file reading. 36 * \{ */ 37 38 /** 39 * Adjust paths when saving (kept unless #BlendFileWriteParams.use_save_as_copy is set). 40 */ 41 typedef enum eBLO_WritePathRemap { 42 /** No path manipulation. */ 43 BLO_WRITE_PATH_REMAP_NONE = 0, 44 /** Remap existing relative paths (default). */ 45 BLO_WRITE_PATH_REMAP_RELATIVE = 1, 46 /** Remap paths making all paths relative to the new location. */ 47 BLO_WRITE_PATH_REMAP_RELATIVE_ALL = 2, 48 /** Make all paths absolute. */ 49 BLO_WRITE_PATH_REMAP_ABSOLUTE = 3, 50 } eBLO_WritePathRemap; 51 52 /** Similar to #BlendFileReadParams. */ 53 struct BlendFileWriteParams { 54 eBLO_WritePathRemap remap_mode; 55 /** Save `.blend1`, `.blend2`... etc. */ 56 uint use_save_versions : 1; 57 /** On write, restore paths after editing them (see #BLO_WRITE_PATH_REMAP_RELATIVE). */ 58 uint use_save_as_copy : 1; 59 uint use_userdef : 1; 60 const struct BlendThumbnail *thumb; 61 }; 62 63 extern bool BLO_write_file(struct Main *mainvar, 64 const char *filepath, 65 const int write_flags, 66 const struct BlendFileWriteParams *params, 67 struct ReportList *reports); 68 69 extern bool BLO_write_file_mem(struct Main *mainvar, 70 struct MemFile *compare, 71 struct MemFile *current, 72 int write_flags); 73 74 /** \} */ 75