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/intern/fluid.c1
-rw-r--r--source/blender/blenloader/intern/versioning_290.c13
-rw-r--r--source/blender/makesdna/DNA_fluid_defaults.h1
-rw-r--r--source/blender/makesdna/DNA_fluid_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_fluid.c12
5 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index f66ba428611..9ad352c8455 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -4985,6 +4985,7 @@ void BKE_fluid_modifier_copy(const struct FluidModifierData *fmd,
tfds->particle_radius = fds->particle_radius;
tfds->particle_band_width = fds->particle_band_width;
tfds->fractions_threshold = fds->fractions_threshold;
+ tfds->fractions_distance = fds->fractions_distance;
tfds->sys_particle_maximum = fds->sys_particle_maximum;
/* diffusion options*/
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index f08e896744b..8622264188a 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -912,4 +912,17 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
+
+ if (!DNA_struct_elem_find(fd->filesdna, "FluidModifierData", "float", "fractions_distance")) {
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
+ if (md->type == eModifierType_Fluid) {
+ FluidModifierData *fmd = (FluidModifierData *)md;
+ if (fmd->domain) {
+ fmd->domain->fractions_distance = 0.5;
+ }
+ }
+ }
+ }
+ }
}
diff --git a/source/blender/makesdna/DNA_fluid_defaults.h b/source/blender/makesdna/DNA_fluid_defaults.h
index 14ea874a674..2ee83cf3387 100644
--- a/source/blender/makesdna/DNA_fluid_defaults.h
+++ b/source/blender/makesdna/DNA_fluid_defaults.h
@@ -109,6 +109,7 @@
.particle_radius = 1.0f, \
.particle_band_width = 3.0f, \
.fractions_threshold = 0.05f, \
+ .fractions_distance = 0.5f, \
.flip_ratio = 0.97f, \
.sys_particle_maximum = 0, \
.simulation_method = FLUID_DOMAIN_METHOD_FLIP, \
diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h
index afb2a294605..2786d4df868 100644
--- a/source/blender/makesdna/DNA_fluid_types.h
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -586,10 +586,11 @@ typedef struct FluidDomainSettings {
float particle_radius;
float particle_band_width;
float fractions_threshold;
+ float fractions_distance;
float flip_ratio;
int sys_particle_maximum;
short simulation_method;
- char _pad4[2];
+ char _pad4[6];
/* Diffusion options. */
float surface_tension;
diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c
index 84187786c46..60eed60ace1 100644
--- a/source/blender/makesrna/intern/rna_fluid.c
+++ b/source/blender/makesrna/intern/rna_fluid.c
@@ -1895,12 +1895,22 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0.001, 1.0);
RNA_def_property_ui_range(prop, 0.01, 1.0, 0.05, -1);
RNA_def_property_ui_text(prop,
- "Obstacle-Fluid Threshold",
+ "Obstacle Threshold",
"Determines how much fluid is allowed in an obstacle cell "
"(higher values will tag a boundary cell as an obstacle easier "
"and reduce the boundary smoothening effect)");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
+ prop = RNA_def_property(srna, "fractions_distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, -5.0, 5.0);
+ RNA_def_property_ui_range(prop, 0.01, 5.0, 0.1, -1);
+ RNA_def_property_ui_text(prop,
+ "Obstacle Distance",
+ "Determines how far apart fluid and obstacle are (higher values will "
+ "result in fluid being further away from obstacles, smaller values "
+ "will let fluid move towards the inside of obstacles)");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset");
+
prop = RNA_def_property(srna, "sys_particle_maximum", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sys_particle_maximum");
RNA_def_property_range(prop, 0, INT_MAX);