Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-05-06 21:12:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-05-06 21:12:44 +0400
commitc8a05922882f7638b91ebcb1cd7a4e89cdf16222 (patch)
treef99cc1d1ebd09538a692c4c018c940efb8ad1655
parent0550512388ca3300ecdca888fb1b675e93c79e19 (diff)
option to use the linked path or the local path for pointcache.
needed for sintels hair to be baked locally.
-rw-r--r--release/scripts/ui/properties_object.py2
-rw-r--r--release/scripts/ui/properties_physics_common.py2
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/makesdna/DNA_object_force.h2
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c5
5 files changed, 11 insertions, 2 deletions
diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py
index 043a0d2434b..211a7f5c2e9 100644
--- a/release/scripts/ui/properties_object.py
+++ b/release/scripts/ui/properties_object.py
@@ -156,7 +156,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
wide_ui = context.region.width > narrowui
split = layout.split(percentage=0.8, align=True)
- split.operator("object.group_link", text="Link to Group")
+ split.operator("object.group_link", text="Add to Group")
split.operator("object.group_add", text="", icon='ZOOMIN')
# XXX, this is bad practice, yes, I wrote it :( - campbell
diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py
index 20073c68989..cad1229a0de 100644
--- a/release/scripts/ui/properties_physics_common.py
+++ b/release/scripts/ui/properties_physics_common.py
@@ -73,6 +73,8 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
sub.prop(cache, "disk_cache")
col.label(text=cache.info)
+ sub = col.column()
+ sub.prop(cache, "use_library_path", "Use Lib Path")
layout.separator()
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);