[Bf-blender-cvs] [5d0370e8c53] fluid-mantaflow: fix for initial velocities
Sebastián Barschkis
noreply at git.blender.org
Thu Sep 21 12:14:20 CEST 2017
Commit: 5d0370e8c53fcc2bbb06b1a89b594535598fae19
Author: Sebastián Barschkis
Date: Thu Sep 21 01:57:31 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB5d0370e8c53fcc2bbb06b1a89b594535598fae19
fix for initial velocities
added sanity check that clears any left over velocities
===================================================================
M source/blender/blenkernel/intern/smoke.c
===================================================================
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index d3900d356d8..bfeaa30ab99 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2451,12 +2451,21 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
int active_fields = sds->active_fields;
float *phiIn = liquid_get_phiin(sds->fluid);
+ float *velxInitial = smoke_get_in_velocity_x(sds->fluid);
+ float *velyInitial = smoke_get_in_velocity_y(sds->fluid);
+ float *velzInitial = smoke_get_in_velocity_z(sds->fluid);
unsigned int z;
/* Resetting levelset grid representation of domain */
for (z = 0; z < sds->res[0] * sds->res[1] * sds->res[2]; z++) {
- if (phiIn)
+ if (phiIn) {
phiIn[z] = 9999;
+ }
+ if (velxInitial && velyInitial && velzInitial) {
+ velxInitial[z] = 0.0f;
+ velyInitial[z] = 0.0f;
+ velzInitial[z] = 0.0f;
+ }
}
/* calculate domain shift for current frame if using adaptive domain */
More information about the Bf-blender-cvs
mailing list