Another addition of time values, yet some things to follow
authorDaniel Genrich <daniel.genrich@gmx.net>
Mon, 7 Jul 2008 09:23:12 +0000 (09:23 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Mon, 7 Jul 2008 09:23:12 +0000 (09:23 +0000)
intern/elbeem/extern/elbeem.h
intern/elbeem/intern/elbeem.cpp
intern/elbeem/intern/ntl_geometryobject.h
intern/elbeem/intern/solver_control.cpp
source/blender/makesdna/DNA_object_fluidsim.h
source/blender/src/buttons_object.c
source/blender/src/fluidsim.c

index 5c1fc64..b8752ef 100644 (file)
@@ -160,6 +160,9 @@ typedef struct elbeemMesh {
        const char *name;
        
        /* fluid control settings */
+       float cpsTimeStart;
+       float cpsTimeEnd;
+       
        // TODO dg: change to channels
        float attractforceStrength;
        float attractforceRadius;
index 1d8f92b..4517e20 100644 (file)
@@ -161,6 +161,9 @@ void elbeemResetMesh(elbeemMesh *mesh) {
        mesh->name = "[unnamed]";
        
        /* fluid control settings */
+       mesh->cpsTimeStart = 0;
+       mesh->cpsTimeEnd = 0;
+       
        mesh->attractforceStrength = 0;
        mesh->attractforceRadius = 0;
        mesh->velocityforceStrength = 0;
@@ -206,6 +209,8 @@ int elbeemAddMesh(elbeemMesh *mesh) {
        obj->setGeoImpactFactor(mesh->obstacleImpactFactor);
        
        /* fluid control features */
+       obj->setCpsTimeStart(mesh->cpsTimeStart);
+       obj->setCpsTimeEnd(mesh->cpsTimeEnd);
        obj->setAttractForceStrength(mesh->attractforceStrength);
        obj->setAttractForceRadius(mesh->attractforceRadius);
        obj->setVelocityForceStrength(mesh->velocityforceStrength);
index fd7455a..6076610 100644 (file)
@@ -101,6 +101,14 @@ class ntlGeometryObject : public ntlGeometryClass
                /****************************************/
                /* fluid control features */
                /****************************************/
+               /*! Set/get the particle control set attract force strength */
+               inline float getCpsTimeStart() const { return mCpsTimeStart; }
+               inline void setCpsTimeStart(float set) { mCpsTimeStart=set; }
+               
+               /*! Set/get the particle control set attract force strength */
+               inline float getCpsTimeEnd() const { return mCpsTimeEnd; }
+               inline void setCpsTimeEnd(float set) { mCpsTimeEnd=set; }
+               
                /*! Set/get the particle control set attract force strength */
                inline float getAttractForceStrength() const { return mAttractforceStrength; }
                inline void setAttractForceStrength(float set) { mAttractforceStrength=set; }
@@ -225,6 +233,9 @@ class ntlGeometryObject : public ntlGeometryClass
                AnimChannel<float> mcGeoActive;
                
                /* fluid control settings */
+               float mCpsTimeStart;
+               float mCpsTimeEnd
+                               ;
                // TODO dg: change to channels
                float mAttractforceStrength;
                float mAttractforceRadius;
index e4c5158..267a1c5 100644 (file)
@@ -239,6 +239,9 @@ LbmFsgrSolver::initCpdata()
                        cset->mcForceVel = AnimChannel<float>(obj->getVelocityForceStrength());
                        cset->mcRadiusVel = AnimChannel<float>(obj->getVelocityForceRadius());
 
+                       cset->mCparts->setCPSTimeStart(obj->getCpsTimeStart());
+                       cset->mCparts->setCPSTimeEnd(obj->getCpsTimeEnd());
+                       
                        // this value can be left at 0.5:
                        cset->mCparts->setCPSMvmWeightFac(0.5);
 
index 51592d7..0c0eff0 100644 (file)
@@ -119,6 +119,9 @@ typedef struct FluidsimSettings {
        struct MVert *meshSurfNormals;
        
        /* Fluid control settings */
+       float cpsTimeStart;
+       float cpsTimeEnd;
+       
        float attractforceStrength;
        float attractforceRadius;
        float velocityforceStrength;
index 9967e69..3a0c9e8 100644 (file)
@@ -5216,19 +5216,18 @@ static void object_panel_fluidsim(Object *ob)
                        }
                        else if(fss->type == OB_FLUIDSIM_CONTROL) {
                                
-                               uiDefBut(block, LABEL, 0, "Attraction force:", 0,yline,300,20, NULL, 0.0, 0, 0, 0, "");
+                               uiDefButF(block, NUM, B_DIFF, "Time Sta:", 0, yline,150,20, &fss->cpsTimeStart, 0.0, 2.0,   10,0, "Specifies time when the control particles are activated.");
+                               uiDefButF(block, NUM, B_DIFF, "Time End:", 150, yline,150,20, &fss->cpsTimeEnd, 0.0, 2.0,   10,0, "Specifies time when the control particles are deactivated.");
                                
                                yline -= lineHeight;
                                
+                               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, "");
                        }
index 768acc1..7298c76 100644 (file)
@@ -219,6 +219,8 @@ FluidsimSettings *fluidsimSettingsNew(struct Object *srcob)
        fss->attractforceRadius = 0.75;
        fss->velocityforceStrength = 0.2;
        fss->velocityforceRadius = 0.75;
+       fss->cpsTimeStart = fss->animStart;
+       fss->cpsTimeEnd = fss->animEnd;
 
        return fss;
 }
@@ -1026,17 +1028,20 @@ void fluidsimBake(struct Object *ob)
                                fsmesh.obstaclePartslip = obit->fluidsimSettings->partSlipValue;
                                fsmesh.volumeInitType = obit->fluidsimSettings->volumeInitType;
                                fsmesh.obstacleImpactFactor = obit->fluidsimSettings->surfaceSmoothing; // misused value
-                               
+                               /*
                                if(fsmesh.type == OB_FLUIDSIM_CONTROL)
                                {
                                        // control fluids will get exported as whole
                                        deform = 1;
                                        
+                                       fsmesh.cpsTimeStart = obit->fluidsimSettings->cpsTimeStart;
+                                       fsmesh.cpsTimeEnd = obit->fluidsimSettings->cpsTimeEnd;
+                                       
                                        fsmesh.attractforceStrength = obit->fluidsimSettings->attractforceStrength;
                                        fsmesh.attractforceRadius = obit->fluidsimSettings->attractforceRadius;
                                        fsmesh.velocityforceStrength = obit->fluidsimSettings->velocityforceStrength;
                                        fsmesh.velocityforceRadius = obit->fluidsimSettings->velocityforceRadius;
-                               }
+                               }*/
 
                                // animated meshes
                                if(deform) {