[Bf-blender-cvs] [95bf31e] master: Resolve T37240: saving a new file always had absolute paths, now remap.

Campbell Barton noreply at git.blender.org
Wed Nov 27 11:18:06 CET 2013


Commit: 95bf31e4fee327f9d0ca7e017997642398e2b023
Author: Campbell Barton
Date:   Wed Nov 27 21:15:19 2013 +1100
http://developer.blender.org/rB95bf31e4fee327f9d0ca7e017997642398e2b023

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

===================================================================

M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index a9c7610..a4c389d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -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);




More information about the Bf-blender-cvs mailing list