Fix [#30954] Fluid obstacle checkbox has no effect
authorDaniel Genrich <daniel.genrich@gmx.net>
Sat, 21 Apr 2012 22:09:09 +0000 (22:09 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Sat, 21 Apr 2012 22:09:09 +0000 (22:09 +0000)
Note: Supporting obstacles which can be enabled/disabled as animated propoerty is not likely to happen. So I marked this as "Won't fix"/TODO.
I also reverted last commit on this bug because it didn't work and disabled the property from UI to avoid confusion.

intern/elbeem/intern/solver_init.cpp
release/scripts/startup/bl_ui/properties_physics_fluid.py

index 58f45e4fbfb4ef839515911efa96c9c932b750d1..7e9f5e7f4202e0d085d925623ecb05e74ceaae3b 100644 (file)
@@ -1453,9 +1453,7 @@ void LbmFsgrSolver::initMovingObstacles(bool staticInit) {
                        //errMsg("GEOACTT"," obj "<<obj->getName()<<" a:"<<active<<","<<wasActive<<"  s"<<sourceTime<<" t"<<targetTime <<" v"<<mObjectSpeeds[OId] );
                        // skip inactive in/out flows
                        if(ntype==CFInvalid){ errMsg("LbmFsgrSolver::initMovingObstacles","Invalid obj type "<<obj->getGeoInitType()); continue; }
                        //errMsg("GEOACTT"," obj "<<obj->getName()<<" a:"<<active<<","<<wasActive<<"  s"<<sourceTime<<" t"<<targetTime <<" v"<<mObjectSpeeds[OId] );
                        // skip inactive in/out flows
                        if(ntype==CFInvalid){ errMsg("LbmFsgrSolver::initMovingObstacles","Invalid obj type "<<obj->getGeoInitType()); continue; }
-                       /* DG: only inflows/outlfows could be activated/deactivated, test new code that everything can be activated
-                       if((!active) && (otype&(CFMbndOutflow|CFMbndInflow)) ) continue; */
-                       if((!active) /* && (otype&(CFMbndOutflow|CFMbndInflow)) */ ) continue;
+                       if((!active) && (otype&(CFMbndOutflow|CFMbndInflow)) ) continue;
 
                        // copied from  recalculateObjectSpeeds
                        mObjectSpeeds[OId] = vec2L(mpParam->calculateLattVelocityFromRw( vec2P( (*mpGiObjects)[OId]->getInitialVelocity(mSimulationTime) )));
 
                        // copied from  recalculateObjectSpeeds
                        mObjectSpeeds[OId] = vec2L(mpParam->calculateLattVelocityFromRw( vec2P( (*mpGiObjects)[OId]->getInitialVelocity(mSimulationTime) )));
index cec4bf125ee889384e109e04b123c90f8e50ca90..beb525bbd076bfa484f581cf16461ff641929b1b 100644 (file)
@@ -55,11 +55,11 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
             return
 
         col.prop(fluid, "type")
             return
 
         col.prop(fluid, "type")
-        if fluid.type not in {'NONE', 'DOMAIN', 'PARTICLE', 'FLUID'}:
+        if fluid.type not in {'NONE', 'DOMAIN', 'PARTICLE', 'FLUID', 'OBSTACLE'}:
             col.prop(fluid, "use")
 
         layout = layout.column()
             col.prop(fluid, "use")
 
         layout = layout.column()
-        if fluid.type not in {'NONE', 'DOMAIN', 'PARTICLE', 'FLUID'}:
+        if fluid.type not in {'NONE', 'DOMAIN', 'PARTICLE', 'FLUID', 'OBSTACLE'}:
             layout.active = fluid.use
 
         if fluid.type == 'DOMAIN':
             layout.active = fluid.use
 
         if fluid.type == 'DOMAIN':