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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h1
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h2
-rw-r--r--source/blender/makesrna/intern/makesrna.c1
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c15
5 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index f0819c8d79d..a1a8d2df154 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -280,6 +280,7 @@ void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob, struct
/***************** Global funcs ****************************/
void BKE_ptcache_remove(void);
+int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_path, short do_ext);
/************ ID specific functions ************************/
void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 7a1b378b3c4..8bbf1a2e74b 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1814,7 +1814,7 @@ static int ptcache_path(PTCacheID *pid, char *filename)
return BLI_add_slash(filename); /* new strlen() */
}
-static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_path, short do_ext)
+int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_path, short do_ext)
{
int len=0;
char *idname;
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index c95e0a1f54a..fb81e2b6402 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -217,6 +217,8 @@ typedef struct SmokeDomainSettings {
char use_coba;
char coba_field; /* simulation field used for the color mapping */
char pad2;
+
+ char cache_filename[1024];
} SmokeDomainSettings;
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 9471d0e3fcf..6c285e57fc3 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -3523,6 +3523,7 @@ static void rna_generate_header(BlenderRNA *UNUSED(brna), FILE *f)
static const char *cpp_classes = ""
"\n"
+"#include <cstdlib>\n"
"#include <string>\n"
"#include <string.h> /* for memcpy */\n"
"\n"
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index c12937bd2bf..8ac7aef0d93 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -396,6 +396,15 @@ static void rna_Smoke_use_color_ramp_set(PointerRNA *ptr, int value)
}
}
+static void rna_SmokeModifier_cache_filename_get(PointerRNA *ptr, char *filename)
+{
+ SmokeDomainSettings *sds = (SmokeDomainSettings *)ptr->data;
+ PTCacheID pid;
+
+ BKE_ptcache_id_from_smoke(&pid, ptr->id.data, sds->smd);
+ ptcache_filename(&pid, filename, sds->smd->time, 1, 1);
+}
+
#else
static void rna_def_smoke_domain_settings(BlenderRNA *brna)
@@ -853,6 +862,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+
+ prop = RNA_def_property(srna, "cache_filename", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_maxlength(prop, 1024);
+ RNA_def_property_string_funcs(prop, "rna_SmokeModifier_cache_filename_get", NULL, NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
}
static void rna_def_smoke_flow_settings(BlenderRNA *brna)