Resolve T37240: saving a new file always had absolute paths, now remap.

This commit is contained in:
Campbell Barton 2013-11-27 21:15:19 +11:00
parent 2123386c70
commit 95bf31e4fe
Notes: blender-bot 2023-02-14 11:40:23 +01:00
Referenced by issue #38405, The texture missing when linked
Referenced by issue #37357, Proxy breaks when moved.
Referenced by issue #37240, Linked objects disappear when opened on another PC
1 changed files with 9 additions and 0 deletions

View File

@ -2652,6 +2652,15 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *U
RNA_string_set(op->ptr, "filepath", name);
/* if we're saving for the first time and prefer relative paths - any existign paths will be absolute,
* enable the option to remap paths to avoid confusion [#37240] */
if ((G.relbase_valid == false) && (U.flag & USER_RELPATHS)) {
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "relative_remap");
if (!RNA_property_is_set(op->ptr, prop)) {
RNA_property_boolean_set(op->ptr, prop, true);
}
}
if (G.save_over) {
if (BLI_exists(name)) {
uiPupMenuSaveOver(C, op, name);