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:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-07-04 19:23:21 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2008-07-04 19:23:21 +0400
commitbaa1001b47c2c6ddcd87dd69af752259f33e431f (patch)
tree94c756088810282e23e689f5e2bdecdf923b26ab /source
parent2b3df6ea63c5b4851711ec14c960acac17147432 (diff)
Initial GUI implementation, yet not functional
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim.h7
-rw-r--r--source/blender/src/buttons_object.c26
-rw-r--r--source/blender/src/fluidsim.c6
3 files changed, 36 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h
index 9b1e4fb56cb..51592d76ec4 100644
--- a/source/blender/makesdna/DNA_object_fluidsim.h
+++ b/source/blender/makesdna/DNA_object_fluidsim.h
@@ -117,6 +117,12 @@ typedef struct FluidsimSettings {
/* save fluidsurface normals in mvert.no, and surface vertex velocities (if available) in mvert.co */
struct MVert *meshSurfNormals;
+
+ /* Fluid control settings */
+ float attractforceStrength;
+ float attractforceRadius;
+ float velocityforceStrength;
+ float velocityforceRadius;
} FluidsimSettings;
@@ -128,6 +134,7 @@ typedef struct FluidsimSettings {
#define OB_FLUIDSIM_INFLOW 16
#define OB_FLUIDSIM_OUTFLOW 32
#define OB_FLUIDSIM_PARTICLE 64
+#define OB_FLUIDSIM_CONTROL 128
#define OB_TYPEFLAG_START 0
#define OB_FSGEO_THIN (1<<(OB_TYPEFLAG_START+1))
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index ba409723784..9967e69fe27 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -4950,9 +4950,11 @@ static void object_panel_fluidsim(Object *ob)
uiDefButS(block, ROW, B_FLUIDSIM_CHANGETYPE ,"Obstacle", 230, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_OBSTACLE,20.0, 3.0, "Object is a fixed obstacle.");
yline -= lineHeight;
- uiDefButS(block, ROW, B_FLUIDSIM_CHANGETYPE ,"Inflow", 90, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_INFLOW, 20.0, 4.0, "Object adds fluid to the simulation.");
- uiDefButS(block, ROW, B_FLUIDSIM_CHANGETYPE ,"Outflow", 160, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_OUTFLOW, 20.0, 5.0, "Object removes fluid from the simulation.");
- uiDefButS(block, ROW, B_FLUIDSIM_MAKEPART ,"Particle", 230, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_PARTICLE,20.0, 3.0, "Object is made a particle system to display particles generated by a fluidsim domain object.");
+ uiDefButS(block, ROW, B_FLUIDSIM_CHANGETYPE ,"Inflow", 90, yline, 52,objHeight, &fss->type, 15.0, OB_FLUIDSIM_INFLOW, 20.0, 4.0, "Object adds fluid to the simulation.");
+ uiDefButS(block, ROW, B_FLUIDSIM_CHANGETYPE ,"Outflow", 142, yline, 52,objHeight, &fss->type, 15.0, OB_FLUIDSIM_OUTFLOW, 20.0, 5.0, "Object removes fluid from the simulation.");
+ uiDefButS(block, ROW, B_FLUIDSIM_MAKEPART ,"Particle", 194, yline, 52,objHeight, &fss->type, 15.0, OB_FLUIDSIM_PARTICLE,20.0, 3.0, "Object is made a particle system to display particles generated by a fluidsim domain object.");
+
+ uiDefButS(block, ROW, B_FLUIDSIM_CHANGETYPE ,"Control", 246, yline, 54,objHeight, &fss->type, 15.0, OB_FLUIDSIM_CONTROL,20.0, 3.0, "Object is made a fluid control mesh, which influences the fluid.");
uiBlockEndAlign(block);
yline -= lineHeight;
yline -= 2*separateHeight;
@@ -5212,6 +5214,24 @@ static void object_panel_fluidsim(Object *ob)
} // disabled for now...
}
+ else if(fss->type == OB_FLUIDSIM_CONTROL) {
+
+ uiDefBut(block, LABEL, 0, "Attraction force:", 0,yline,300,20, NULL, 0.0, 0, 0, 0, "");
+
+ yline -= lineHeight;
+
+ uiDefButF(block, NUM, B_DIFF, "Strength:", 0, yline,150,20, &fss->attractforceStrength, 0.0, 2.0, 10,0, "");
+ uiDefButF(block, NUM, B_DIFF, "Radius:", 150, yline,150,20, &fss->attractforceRadius, 0.0, 2.0, 10,0, "");
+
+ yline -= lineHeight;
+
+ uiDefBut(block, LABEL, 0, "Velocity force:", 0,yline,300,20, NULL, 0.0, 0, 0, 0, "");
+
+ yline -= lineHeight;
+
+ uiDefButF(block, NUM, B_DIFF, "Strength:", 0, yline,150,20, &fss->velocityforceStrength, 0.0, 2.0, 10,0, "");
+ uiDefButF(block, NUM, B_DIFF, "Radius:", 150, yline,150,20, &fss->velocityforceRadius, 0.0, 2.0, 10,0, "");
+ }
else {
yline -= lineHeight + 5;
/* not yet set */
diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c
index 8b9c89656fb..58e5a96c41c 100644
--- a/source/blender/src/fluidsim.c
+++ b/source/blender/src/fluidsim.c
@@ -213,6 +213,12 @@ FluidsimSettings *fluidsimSettingsNew(struct Object *srcob)
fss->surfaceSubdivs = 1.0;
fss->particleInfSize = 0.0;
fss->particleInfAlpha = 0.0;
+
+ // init fluid control settings
+ fss->attractforceStrength = 0.2;
+ fss->attractforceRadius = 0.75;
+ fss->velocityforceStrength = 0.2;
+ fss->velocityforceRadius = 0.75;
return fss;
}