diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-05-06 21:12:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-05-06 21:12:44 +0400 |
commit | c8a05922882f7638b91ebcb1cd7a4e89cdf16222 (patch) | |
tree | f99cc1d1ebd09538a692c4c018c940efb8ad1655 /source | |
parent | 0550512388ca3300ecdca888fb1b675e93c79e19 (diff) |
option to use the linked path or the local path for pointcache.
needed for sintels hair to be baked locally.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_force.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 25f8dc9bd56..b42ac6fdf49 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1076,7 +1076,7 @@ static int ptcache_path(PTCacheID *pid, char *filename) char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */ char *blendfilename; - blendfilename= (lib)? lib->filename: G.sce; + blendfilename= (lib && (pid->cache->flag & PTCACHE_IGNORE_LIBPATH)==0) ? lib->filename: G.sce; BLI_split_dirfile(blendfilename, NULL, file); i = strlen(file); diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index ca8b6640226..63a6b8fbe4a 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -365,6 +365,8 @@ typedef struct SoftBody { #define PTCACHE_FRAMES_SKIPPED 256 #define PTCACHE_EXTERNAL 512 #define PTCACHE_READ_INFO 1024 +/* dont use the filename of the blendfile the data is linked from (write a local cache) */ +#define PTCACHE_IGNORE_LIBPATH 2048 /* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */ #define PTCACHE_REDO_NEEDED 258 diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index d7acb427efe..5cb58d50f8f 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -746,6 +746,11 @@ static void rna_def_pointcache(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_EXTERNAL); RNA_def_property_ui_text(prop, "External", "Read cache from an external location"); RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); + + prop= RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PTCACHE_IGNORE_LIBPATH); + RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked indo another file."); + RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); prop= RNA_def_property(srna, "point_cache_list", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); |