[Bf-blender-cvs] [b023c911185] master: Fluid: Use dynamic mode whenever active rigid bodies are in the scene

Sebastián Barschkis noreply at git.blender.org
Sun Mar 29 21:31:30 CEST 2020


Commit: b023c911185636293e928ef998f4c9cad2c15d9c
Author: Sebastián Barschkis
Date:   Sun Mar 29 18:51:18 2020 +0200
Branches: master
https://developer.blender.org/rBb023c911185636293e928ef998f4c9cad2c15d9c

Fluid: Use dynamic mode whenever active rigid bodies are in the scene

Required for collisions with moving rigid bodies. Otherwise the static optimization mode will be kept and the obstacles would be calculated only once at the beginning.

===================================================================

M	source/blender/blenkernel/intern/fluid.c

===================================================================

diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index b8d9718920e..b095e6dbeec 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -36,6 +36,7 @@
 #include "DNA_fluid_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
+#include "DNA_rigidbody_types.h"
 
 #include "BKE_effect.h"
 #include "BKE_fluid.h"
@@ -644,6 +645,11 @@ static bool is_static_object(Object *ob)
     }
   }
 
+  /* Active rigid body objects considered to be dynamic fluid objects. */
+  if (ob->rigidbody_object && ob->rigidbody_object->type == RBO_TYPE_ACTIVE) {
+    return false;
+  }
+
   /* Finally, check if the object has animation data. If so, it is considered dynamic. */
   return !BKE_object_moves_in_time(ob, true);
 }



More information about the Bf-blender-cvs mailing list