pointcache support for relative external paths with the useual // prefix as well as library path option.
This commit is contained in:
@@ -46,7 +46,10 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
|
||||
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)
|
||||
|
@@ -1067,20 +1067,20 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
|
||||
|
||||
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);
|
||||
|
Reference in New Issue
Block a user