[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30297] trunk/blender: pointcache support for relative external paths with the useual // prefix as well as library path option.
Campbell Barton
ideasman42 at gmail.com
Wed Jul 14 09:47:03 CEST 2010
Revision: 30297
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30297
Author: campbellbarton
Date: 2010-07-14 09:47:03 +0200 (Wed, 14 Jul 2010)
Log Message:
-----------
pointcache support for relative external paths with the useual // prefix as well as library path option.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_physics_common.py
trunk/blender/source/blender/blenkernel/intern/pointcache.c
Modified: trunk/blender/release/scripts/ui/properties_physics_common.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_common.py 2010-07-14 07:35:39 UTC (rev 30296)
+++ trunk/blender/release/scripts/ui/properties_physics_common.py 2010-07-14 07:47:03 UTC (rev 30297)
@@ -46,7 +46,10 @@
split.prop(cache, "name", text="File Name")
split.prop(cache, "index", text="")
- layout.label(text="File Path:")
+ row = layout.row()
+ row.label(text="File Path:")
+ row.prop(cache, "use_library_path", "Use Lib Path")
+
layout.prop(cache, "filepath", text="")
layout.label(text=cache.info)
Modified: trunk/blender/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pointcache.c 2010-07-14 07:35:39 UTC (rev 30296)
+++ trunk/blender/source/blender/blenkernel/intern/pointcache.c 2010-07-14 07:47:03 UTC (rev 30297)
@@ -1067,21 +1067,21 @@
static int ptcache_path(PTCacheID *pid, char *filename)
{
- Library *lib;
+ Library *lib= (pid)? pid->ob->id.lib: NULL;
+ const char *blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filepath: G.sce;
size_t i;
- lib= (pid)? pid->ob->id.lib: NULL;
-
if(pid->cache->flag & PTCACHE_EXTERNAL) {
strcpy(filename, pid->cache->path);
+
+ if(strncmp(filename, "//", 2)==0)
+ BLI_path_abs(filename, blendfilename);
+
return BLI_add_slash(filename); /* new strlen() */
}
else if (G.relbase_valid || lib) {
char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */
- char *blendfilename;
- blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filepath: G.sce;
-
BLI_split_dirfile(blendfilename, NULL, file);
i = strlen(file);
More information about the Bf-blender-cvs
mailing list