[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59814] trunk/blender/source/blender/ blenkernel/intern/bpath.c: Find missing files now keeps relative paths relative instead of turning them
Brecht Van Lommel
brechtvanlommel at pandora.be
Thu Sep 5 02:37:06 CEST 2013
Revision: 59814
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59814
Author: blendix
Date: 2013-09-05 00:37:06 +0000 (Thu, 05 Sep 2013)
Log Message:
-----------
Find missing files now keeps relative paths relative instead of turning them
into absolute paths.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/bpath.c
Modified: trunk/blender/source/blender/blenkernel/intern/bpath.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/bpath.c 2013-09-04 23:44:41 UTC (rev 59813)
+++ trunk/blender/source/blender/blenkernel/intern/bpath.c 2013-09-05 00:37:06 UTC (rev 59814)
@@ -297,7 +297,14 @@
return false;
}
else {
+ bool was_relative = BLI_path_is_rel(path_dst);
+
BLI_strncpy(path_dst, filename_new, FILE_MAX);
+
+ /* keep path relative if the previous one was relative */
+ if (was_relative)
+ BLI_path_rel(path_dst, data->basedir);
+
return true;
}
}
@@ -307,6 +314,7 @@
{
struct BPathFind_Data data = {NULL};
+ data.basedir = bmain->name;
data.reports = reports;
data.searchdir = searchpath;
data.find_all = find_all;
@@ -330,6 +338,9 @@
path_src = path;
}
+ /* so functions can check old value */
+ BLI_strncpy(path_dst, path, FILE_MAX);
+
if (visit_cb(userdata, path_dst, path_src)) {
BLI_strncpy(path, path_dst, FILE_MAX);
return true;
More information about the Bf-blender-cvs
mailing list