[Bf-blender-cvs] [d2ed551] fluid-mantaflow: made particle radius factor field accessible
Sebastián Barschkis
noreply at git.blender.org
Sun Sep 4 23:25:09 CEST 2016
Commit: d2ed5517c21cec8f8ece87c2bc65dba06a37ef4f
Author: Sebastián Barschkis
Date: Mon Aug 29 22:17:57 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBd2ed5517c21cec8f8ece87c2bc65dba06a37ef4f
made particle radius factor field accessible
===================================================================
M intern/mantaflow/intern/FLUID.cpp
M intern/mantaflow/intern/strings/liquid_script.h
M release/scripts/startup/bl_ui/properties_physics_smoke.py
M source/blender/blenkernel/intern/smoke.c
M source/blender/makesdna/DNA_smoke_types.h
M source/blender/makesrna/intern/rna_smoke.c
===================================================================
diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index 06fa89e..1b7ba67 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -574,10 +574,12 @@ std::string FLUID::getRealValue(const std::string& varName, SmokeModifierData *
ss << smd->domain->flame_smoke_color[2];
else if (varName == "CURRENT_FRAME")
ss << md->scene->r.cfra;
- else if (varName == "RANDOMNESS")
+ else if (varName == "PARTICLE_RANDOMNESS")
ss << smd->domain->particle_randomness;
else if (varName == "PARTICLE_NUMBER")
ss << smd->domain->particle_number;
+ else if (varName == "PARTICLE_RADIUS")
+ ss << smd->domain->particle_radius;
else if (varName == "GRAVITY_X")
ss << smd->domain->gravity[0];
else if (varName == "GRAVITY_Y")
diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h
index 5e8aa5a..b70f730 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -57,10 +57,10 @@ narrowBand = True\n\
narrowBandWidth = 3\n\
combineBandWidth = narrowBandWidth - 1\n\
\n\
-minParticles = pow(2,dim)\n\
particleNumber = $PARTICLE_NUMBER$\n\
-radiusFactor = 1.0\n\
-randomness = $RANDOMNESS$\n\
+minParticles = pow(particleNumber,dim)\n\
+radiusFactor = $PARTICLE_RADIUS$\n\
+randomness = $PARTICLE_RANDOMNESS$\n\
\n\
step = -1\n\
maxVel = 0\n\
@@ -68,9 +68,7 @@ maxVel = 0\n\
using_highres = $USE_WAVELETS$\n";
const std::string liquid_variables_high = "\n\
-mantaMsg('Liquid variables high')\n\
-scale = 0.5\n\
-xl_radiusFactor = 2.5\n";
+mantaMsg('Liquid variables high')\n";
//////////////////////////////////////////////////////////////////////
// GRIDS & MESH & PARTICLESYSTEM
@@ -364,6 +362,4 @@ if 'step' in globals() : del step\n\
if 'maxVel' in globals() : del maxVel\n";
const std::string liquid_delete_variables_high = "\n\
-mantaMsg('Deleting highres liquid variables')\n\
-if 'scale' in globals() : del scale\n\
-if 'xl_radiusFactor' in globals() : del xl_radiusFactor\n";
+mantaMsg('Deleting highres liquid variables')\n";
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index 174c0d1..ed54498 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -108,11 +108,12 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
split = layout.split()
split.enabled = not domain.point_cache.is_baked
- col = split.column(align=True)
+ col = split.column()
col.label(text="Liquid:")
col.prop(domain, "particle_randomness")
+ col.prop(domain, "particle_radius")
- col = split.column(align=True)
+ col = split.column()
col.label()
col.prop(domain, "particle_number")
@@ -136,7 +137,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
-
+
if flow.smoke_flow_type in {'SMOKE', 'BOTH', 'FIRE'}:
col.label(text="Initial Values:")
if flow.smoke_flow_type in {'SMOKE', 'BOTH'}:
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index d72b205..7691ee6 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -594,6 +594,7 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
/* liquid */
smd->domain->particle_randomness = 0.1f;
smd->domain->particle_number = 2;
+ smd->domain->particle_radius = 1.0f;
/*mantaflow settings*/
smd->domain->manta_solver_res = 3;
@@ -703,6 +704,7 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
tsmd->domain->particle_randomness = smd->domain->particle_randomness;
tsmd->domain->particle_number = smd->domain->particle_number;
+ tsmd->domain->particle_radius = smd->domain->particle_radius;
tsmd->domain->manta_solver_res = smd->domain->manta_solver_res;
tsmd->domain->noise_pos_scale = smd->domain->noise_pos_scale;
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index bebaf17..420a540 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -188,6 +188,8 @@ typedef struct SmokeDomainSettings {
/* liquid parameters */
float particle_randomness;
int particle_number;
+ float particle_radius;
+ int pad4;
/* mantaflow settings */
struct FLUID *fluid;
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 17edbb5..f2a3605 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -822,7 +822,13 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "particle_number", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_range(prop, 1, 5, 2, -1);
- RNA_def_property_ui_text(prop, "Discretization", "Particle number factor (higher value results in more particles)");
+ RNA_def_property_ui_text(prop, "Number", "Particle number factor (higher value results in more particles)");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
+
+ prop = RNA_def_property(srna, "particle_radius", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0, 10.0);
+ RNA_def_property_ui_range(prop, 0.0, 10.0, 0.02, 5);
+ RNA_def_property_ui_text(prop, "Radius", "Particle radius factor (higher value results in larger particles)");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
More information about the Bf-blender-cvs
mailing list