[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32882] trunk/blender/source/blender: workaround/fix for [#24540] Adding the path to an image Editor in the file preferences window messes up the path

Campbell Barton ideasman42 at gmail.com
Fri Nov 5 07:33:34 CET 2010


Revision: 32882
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32882
Author:   campbellbarton
Date:     2010-11-05 07:33:33 +0100 (Fri, 05 Nov 2010)

Log Message:
-----------
workaround/fix for [#24540] Adding the path to an image Editor in the file preferences window messes up the path
when selecting paths from the user preferences always default relative option to off.
otherwise you get paths like '//..\..\..\..\Program Files\GIMP-2.0\bin\gimp-2.6.exe'

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_buttons/buttons_ops.c
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_buttons/buttons_ops.c	2010-11-05 05:26:34 UTC (rev 32881)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_ops.c	2010-11-05 06:33:33 UTC (rev 32882)
@@ -175,10 +175,12 @@
 		RNA_string_set(op->ptr, "filepath", str);
 		MEM_freeN(str);
 
-		if(RNA_struct_find_property(op->ptr, "relative_path"))
-			if(!RNA_property_is_set(op->ptr, "relative_path"))
-				RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
-
+		if(RNA_struct_find_property(op->ptr, "relative_path")) {
+			if(!RNA_property_is_set(op->ptr, "relative_path")) {
+				/* annoying exception!, if were dealign with the user prefs, default relative to be off */
+				RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
+			}
+		}
 		WM_event_add_fileselect(C, op);
 
 		return OPERATOR_RUNNING_MODAL;

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2010-11-05 05:26:34 UTC (rev 32881)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2010-11-05 06:33:33 UTC (rev 32882)
@@ -2763,11 +2763,11 @@
 	RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
 	RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
 
-	prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_DIRPATH);
+	prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
 	RNA_def_property_string_sdna(prop, NULL, "image_editor");
 	RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
 	
-	prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_DIRPATH);
+	prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
 	RNA_def_property_string_sdna(prop, NULL, "anim_player");
 	RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player");
 





More information about the Bf-blender-cvs mailing list