diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index a4d5bed21da..b796176fb3a 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1719,6 +1719,7 @@ static bool wm_file_write(bContext *C, int fileflags, eBLO_WritePathRemap remap_mode, bool use_save_as_copy, + const bool use_legacy_mesh_format, ReportList *reports) { Main *bmain = CTX_data_main(C); @@ -1830,6 +1831,7 @@ static bool wm_file_write(bContext *C, .remap_mode = remap_mode, .use_save_versions = true, .use_save_as_copy = use_save_as_copy, + .use_legacy_mesh_format = use_legacy_mesh_format, .thumb = thumb, }, reports)) { @@ -3064,6 +3066,8 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) char path[FILE_MAX]; const bool is_save_as = (op->type->invoke == wm_save_as_mainfile_invoke); const bool use_save_as_copy = is_save_as && RNA_boolean_get(op->ptr, "copy"); + const bool use_legacy_mesh_format = is_save_as && + RNA_boolean_get(op->ptr, "use_legacy_mesh_format"); /* We could expose all options to the users however in most cases remapping * existing relative paths is a good default. @@ -3107,7 +3111,8 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) /* set compression flag */ SET_FLAG_FROM_TEST(fileflags, RNA_boolean_get(op->ptr, "compress"), G_FILE_COMPRESS); - const bool ok = wm_file_write(C, path, fileflags, remap_mode, use_save_as_copy, op->reports); + const bool ok = wm_file_write( + C, path, fileflags, remap_mode, use_save_as_copy, use_legacy_mesh_format, op->reports); if ((op->flag & OP_IS_INVOKE) == 0) { /* OP_IS_INVOKE is set when the operator is called from the GUI. @@ -3198,6 +3203,13 @@ void WM_OT_save_as_mainfile(wmOperatorType *ot) "Save Copy", "Save a copy of the actual working state but does not make saved file active"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); + prop = RNA_def_boolean( + ot->srna, + "use_legacy_mesh_format", + false, + "Legacy Mesh Format", + "Save mesh data with a legacy format that can be read by earlier versions"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); } static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) |